82 Commits

Author SHA1 Message Date
df809df9a5 Bump to 0.2.63 (#2163)
* Update `syn` version requirement

Require latest version to fix issues with nightly.

* Bump to 0.2.63
2020-05-27 10:07:18 -05:00
996e92f3ae Mass rename anyref to externref (#2142)
Updates a mess of dependencies and tracks the most recent version of the
reference types specification.
2020-05-18 09:36:30 -05:00
8e3d6fe619 Update the walrus dependency (#2125)
This commit updates the `walrus` crate used in `wasm-bindgen`. The major
change here is how `walrus` handles element segments, exposing segments
rather than trying to keep a contiugous array of all the elements and
doing the splitting itself. That means that we need to do mroe logic
here in `wasm-bindgen` to juggle indices, segments, etc.
2020-05-06 12:57:02 -05:00
d896446edc Bump to 0.2.62 (#2119) 2020-05-01 10:34:36 -05:00
6d61cd8b76 Bump to 0.2.61 (#2113) 2020-04-29 11:22:35 -05:00
a19c8a3fe0 Bump to 0.2.60 (#2051)
* Bump to 0.2.60

* Try to fix CI

* Fix CI syntax
2020-03-25 16:33:36 -05:00
db8d3e4412 Bump to 0.2.59 (#2026)
Wow this is a big release!
2020-03-03 10:55:51 -06:00
93cb6cb65d Symlink LICENSE files in crates (#2018) 2020-02-28 17:41:28 -06:00
2902ceb26f Bump to 0.2.58 (#1946) 2020-01-07 13:48:25 -06:00
56e4d7de1d Bump to 0.2.57 (#1943) 2020-01-06 13:17:28 -06:00
580daab1d3 Release 0.2.56 (#1922) 2019-12-20 10:31:17 -06:00
9469c1641b Remove reliance on wat2wasm in interpreter tests (#1893)
Move usage to the `wat` crate instead.
2019-12-03 14:09:33 -06:00
8e56cdacc5 Rewrite wasm-bindgen with updated interface types proposal (#1882)
This commit is a pretty large scale rewrite of the internals of wasm-bindgen. No user-facing changes are expected as a result of this PR, but due to the scale of changes here it's likely inevitable that at least something will break. I'm hoping to get more testing in though before landing!

The purpose of this PR is to update wasm-bindgen to the current state of the interface types proposal. The wasm-bindgen tool was last updated when it was still called "WebIDL bindings" so it's been awhile! All support is now based on https://github.com/bytecodealliance/wasm-interface-types which defines parsers/binary format/writers/etc for wasm-interface types.

This is a pretty massive PR and unfortunately can't really be split up any more afaik. I don't really expect realistic review of all the code here (or commits), but some high-level changes are:

* Interface types now consists of a set of "adapter functions". The IR in wasm-bindgen is modeled the same way not.
* Each adapter function has a list of instructions, and these instructions work at a higher level than wasm itself, for example with strings.
* The wasm-bindgen tool has a suite of instructions which are specific to it and not present in the standard. (like before with webidl bindings)
* The anyref/multi-value transformations are now greatly simplified. They're simply "optimization passes" over adapter functions, removing instructions that are otherwise present. This way we don't have to juggle so much all over the place, and instructions always have the same meaning.
2019-12-03 11:16:44 -06:00
db9d603c8f Bump to 0.2.55 (#1864) 2019-11-19 11:04:37 -06:00
3573164b52 Bump to 0.2.54 (#1854) 2019-11-07 12:59:01 -06:00
935f71afec Switch from failure to anyhow (#1851)
This commit switches all of `wasm-bindgen` from the `failure` crate to
`anyhow`. The `anyhow` crate should serve all the purposes that we
previously used `failure` for but has a few advantages:

* It's based on the standard `Error` trait rather than a custom `Fail`
  trait, improving ecosystem compatibility.
* We don't need a `#[derive(Fail)]`, which means that's less code to
  compile for `wasm-bindgen`. This notably helps the compile time of
  `web-sys` itself.
* Using `Result<()>` in `fn main` with `anyhow::Error` produces
  human-readable output, so we can use that natively.
2019-11-04 11:35:28 -06:00
c7c169ae72 Bump to 0.2.53 (#1840) 2019-10-29 09:37:37 -05:00
a20dd26dde Bump to 0.2.52 (#1833) 2019-10-24 16:08:45 -05:00
6d1dc813c4 Bump to 0.2.51 (#1797)
This notably brings in async/await support for current beta/nightly
users. Yay!
2019-09-26 14:07:28 -05:00
582b733967 Update to walrus 0.12.0 2019-09-10 17:32:30 -07:00
c2daa4f63c Bump to 0.2.50 2019-08-19 04:21:27 -07:00
c1d4fddeac Bump to 0.2.49 2019-08-14 08:32:02 -07:00
aace8cedee Move table export to the anyref pass
Turns out #1704 was buggy and ended up never injecting initialization
because the anyref table was never present! This fixes that issue and
this should now be tested on CI to ensure this doesn't regress and
future changes preserve correctness
2019-08-13 12:08:56 -07:00
ad34fa29d8 Update with list IR from walrus
This commit updates `wasm-bindgen` to the latest version of `walrus`
which transforms all internal IR representations to a list-based IR
instead of a tree-based IR. This isn't a major change other than
cosmetic for `wasm-bindgen` itself, but involves a lot of changes to the
threads/anyref passes.

This commit also updates our CI configuration to actually run all the
anyref tests on CI. This is done by downloading a nightly build of
node.js which is theorized to continue to be there for awhile until the
full support makes its way into releases.
2019-08-13 11:17:55 -07:00
7158144932 Update to walrus 0.10.0
Ensure that we enable the new `parallel` feature in the CLI so our tools all use
parallelized parsing, but none of our specific crates need it for usage.
2019-07-30 07:56:18 -07:00
0daa290129 Update to walrus 0.9.0
This commit updates the `walrus` dependency with recent upstream API
changes in `walrus` itself, namely updates to passive segements and how
memory data segments are handled
2019-07-29 13:25:32 -07:00
e596ef596c Bump to 0.2.48 2019-07-11 15:02:39 -07:00
d71ab78fc6 Bump to 0.2.47 2019-06-19 11:14:37 -07:00
8fc0a38402 Bump to 0.2.46 2019-06-14 11:44:58 -07:00
59e773f5ec Update walrus 2019-06-05 11:08:04 -07:00
ff0a50e31e Fix failing interpreter tests 2019-06-05 07:52:14 -07:00
68c5233f80 First refactor for WebIDL bindings
This commit starts the `wasm-bindgen` CLI tool down the road to being a
true polyfill for WebIDL bindings. This refactor is probably the first
of a few, but is hopefully the largest and most sprawling and everything
will be a bit more targeted from here on out.

The goal of this refactoring is to separate out the massive
`crates/cli-support/src/js/mod.rs` into a number of separate pieces of
functionality. It currently takes care of basically everything
including:

* Binding intrinsics
* Handling anyref transformations
* Generating all JS for imports/exports
* All the logic for how to import and how to name imports
* Execution and management of wasm-bindgen closures

Many of these are separable concerns and most overlap with WebIDL
bindings. The internal refactoring here is intended to make it more
clear who's responsible for what as well as making some existing
operations much more straightforward. At a high-level, the following
changes are done:

1. A `src/webidl.rs` module is introduced. The purpose of this module is
   to take all of the raw wasm-bindgen custom sections from the module
   and transform them into a WebIDL bindings section.

  This module has a placeholder `WebidlCustomSection` which is nowhere
  near the actual custom section but if you squint is in theory very
  similar. It's hoped that this will eventually become the true WebIDL
  custom section, currently being developed in an external crate.

  Currently, however, the WebIDL bindings custom section only covers a
  subset of the functionality we export to wasm-bindgen users. To avoid
  leaving them high and dry this module also contains an auxiliary
  custom section named `WasmBindgenAux`. This custom section isn't
  intended to have a binary format, but is intended to represent a
  theoretical custom section necessary to couple with WebIDL bindings to
  achieve all our desired functionality in `wasm-bindgen`. It'll never
  be standardized, but it'll also never be serialized :)

2. The `src/webidl.rs` module now takes over quite a bit of
   functionality from `src/js/mod.rs`. Namely it handles synthesis of an
   `export_map` and an `import_map` mapping export/import IDs to exactly
   what's expected to be hooked up there. This does not include type
   information (as that's in the bindings section) but rather includes
   things like "this is the method of class A" or "this import is from
   module `foo`" and things like that. These could arguably be subsumed
   by future JS features as well, but that's for another time!

3. All handling of wasm-bindgen "descriptor functions" now happens in a
   dedicated `src/descriptors.rs` module. The output of this module is
   its own custom section (intended to be immediately consumed by the
   WebIDL module) which is in theory what we want to ourselves emit one
   day but rustc isn't capable of doing so right now.

4. Invocations and generations of imports are completely overhauled.
   Using the `import_map` generated in the WebIDL step all imports are
   now handled much more precisely in one location rather than
   haphazardly throughout the module. This means we have precise
   information about each import of the module and we only modify
   exactly what we're looking at. This also vastly simplifies intrinsic
   generation since it's all simply a codegen part of the `rust2js.rs`
   module now.

5. Handling of direct imports which don't have a JS shim generated is
   slightly different from before and is intended to be
   future-compatible with WebIDL bindings in its full glory, but we'll
   need to update it to handle cases for constructors and method calls
   eventually as well.

6. Intrinsic definitions now live in their own file (`src/intrinsic.rs`)
   and have a separated definition for their symbol name and signature.
   The actual implementation of each intrinsic lives in `rust2js.rs`

There's a number of TODO items to finish before this merges. This
includes reimplementing the anyref pass and actually implementing import
maps for other targets. Those will come soon in follow-up commits, but
the entire `tests/wasm/main.rs` suite is currently passing and this
seems like a good checkpoint.
2019-06-05 07:52:14 -07:00
137bbdf2e3 Bump to 0.2.45 2019-05-20 09:44:03 -07:00
d422436487 Update dependencies and use new walrus custom sections APIs 2019-05-17 14:58:50 -07:00
773c6ff430 Bump to 0.2.44 2019-05-16 07:47:23 -07:00
5a017c1e22 Update walrus dependency 2019-05-03 07:12:28 -07:00
f2429be07f Bump to 0.2.43 2019-04-29 08:28:41 -07:00
df6e15e3ab Bump to 0.2.42 2019-04-11 07:39:45 -07:00
02394724ea Bump to 0.2.41 2019-04-10 10:53:32 -07:00
6803c619bb Bump to 0.2.40 2019-03-21 17:08:48 -07:00
228f58dca3 Bump to 0.2.39 2019-03-13 11:02:27 -07:00
795bf7c6b1 Update walrus to 0.5.0 2019-03-06 15:09:20 -08:00
a659f27c07 Bump to 0.2.38 2019-03-04 09:11:23 -08:00
8fb705a1ef Upgrade to walrus 0.4
Also be sure to have an explicit GC pass!
2019-02-19 14:14:01 -08:00
9bab9d4af1 Fix an assert while deleting table elements
LLVM's mergefunc pass may mean that the same descriptor function is used
for different closure invocation sites even when the closure itself is
different. This typically only happens with LTO but in theory could
happen at any time!

The assert was tripping when we tried to delete the same function table
entry twice, so instead of a `Vec<usize>` of entries to delete this
commit switches to a `HashSet<usize>` which should do the deduplication
for us and enusre that we delete each descriptor only once.

Closes #1264
2019-02-19 08:17:14 -08:00
e9f423d57e Bump to 0.2.37 2019-02-15 08:16:24 -08:00
17dc79e4c5 Configure walrus to generate DWARF/names at the right times
Fixes ##1254
2019-02-14 07:20:43 -08:00
802cfedcbd Bump to 0.2.36 2019-02-12 13:19:02 -08:00
6f00d9563f interpreter: handle closure descriptors with less than two parameters
This might happen because of LTO.

Fixes #1244
2019-02-12 12:57:22 -08:00
d9cf9b3735 Bump to version 0.2.35 2019-02-12 11:36:19 -08:00