Commit Graph

21 Commits

Author SHA1 Message Date
Alex Crichton
22ca15f81e Bump to 0.2.28 2018-11-12 09:28:01 -08:00
Alex Crichton
6dfbb4be89 Bump to 0.2.27 2018-10-29 14:30:33 -07:00
Alex Crichton
7fad2bf0c8 Bump to 0.2.26 2018-10-29 12:56:37 -07:00
Alex Crichton
a4a2ec605d Update parity-wasm
Bring in some support for bulk-memory-operations instructions
2018-10-16 14:04:40 -07:00
Nick Fitzgerald
dd82a3e134 Bump to 0.2.25 2018-10-10 13:19:40 -07:00
Alex Crichton
79e4324a3b Update parity-wasm dependency
While doing this, make `parity-wasm` a public dependency of all crates
instead of using the `Any` trick as that's not really needed any more.
2018-10-08 10:01:53 -07:00
Alex Crichton
c210ccd596 Bump to 0.2.24 2018-10-05 09:53:19 -07:00
Alex Crichton
8ba41cce6e Improve codegen for Closure<T>
This commit improves the codegen for `Closure<T>`, primarily for ZST
where the closure doesn't actually capture anything. Previously
`wasm-bindgen` would unconditionally allocate an `Rc` for a fat pointer,
meaning that it would always hit the allocator even when the `Box<T>`
didn't actually contain an allocation. Now the reference count for the
closure is stored on the JS object rather than in Rust.

Some more advanced tests were added along the way to ensure that
functionality didn't regress, and otherwise the calling convention for
`Closure` changed a good deal but should still be the same user-facing.
The primary change was that the reference count reaching zero may cause
JS to need to run the destructor. It simply returns this information in
`Drop for Closure` and otherwise when calling it now also retains a
function pointer that runs the destructor.

Closes #874
2018-09-29 07:00:53 -07:00
Alex Crichton
7ecf4aae87 cargo +nightly fmt --all
Rustfmt all the things!
2018-09-26 08:26:00 -07:00
Nick Fitzgerald
f834a427d7 Bump to version 0.2.23 (and js-sys and wasm-bindgen-futures to 0.3.0) 2018-09-26 07:31:54 -07:00
Alex Crichton
51ec485c94 Bump to 0.2.22 2018-09-21 13:41:58 -07:00
Alex Crichton
a117c057fb More conservatively patch closure descriptors
Previously `wasm-bindgen` would take its `breaks_if_inlined` shims and
attempt to remove them entirely, replacing calls to `breaks_if_inlined`
to the imported closure factories. This worked great in that it would
remove the `breaks_if_inlined` funtion entirely, removing the "cost" of
the `#[inline(never)]`.

Unfortunately as #864 discovered this is "too clever by half". LLVM's
aggressive optimizations won't inline `breaks_if_inlined`, but it may
still change the ABI! We can't replace calls to `breaks_if_inlined` if
the signature changes, because the function its calling has a fixed signature.

This commit cops out a bit and instead of replacing calls to
`breaks_if_inlined` to the imported closure factories, we instead
rewrite calls to `__wbindgen_describe_closure` to the closure factories.
This means that the `breaks_if_inlined` shims do not get removed. It
also means that the closure factory shims have a third and final
argument (what would be the function pointer of the descriptor function)
which is dead and unused.

This should be a functional solution for now and let us iterate on a
true fix later on (if needed). For now the cost of this
`#[inline(never)]` and the extra unused argument should be quite small.

Closes #864
2018-09-21 13:34:59 -07:00
Alex Crichton
f18b10ca52 Bump to 0.2.21 2018-09-06 22:10:11 -07:00
Alex Crichton
e67397ec27
Merge pull request #793 from alexcrichton/bump
Bump to 0.2.20
2018-09-06 14:49:54 -07:00
Alex Crichton
9d5898ab48 Bump to 0.2.20 2018-09-06 14:49:43 -07:00
Alex Crichton
5a3cd893e0 Implement AsRef<JsValue> for Closure<T>
This commit adds an implementation of `AsRef<JsValue>` for the `Closure<T>`
type. Previously this was not possible because the `JsValue` didn't actually
exist until the closure was passed to JS, but the implementation has been
changed to ... something a bit more unconventional. The end result, however, is
that `Closure<T>` now always contains a `JsValue`.

The end result of this work is intended to be a precursor to binding callbacks
in `web-sys` as `JsValue` everywhere but still allowing usage with `Closure<T>`.
2018-09-06 14:46:59 -07:00
Alex Crichton
f7e6fa2a04 Bump dependency on parity-wasm to 0.32.0
Brings support for atomic instructions!
2018-08-28 10:12:56 -07:00
Alex Crichton
d9bc0a3176 Bump to 0.2.19 2018-08-27 13:39:23 -07:00
Alex Crichton
98008b9e77 Bump to 0.2.18
At the same time, also add a `publish.rs` script to ease our publishing woes.
2018-08-27 13:37:55 -07:00
Alex Crichton
bf791efe2c Fix wasm-interpreter with mixed types of imports
We counted all imports until the index of the descriptor function, now we only
count imported functions
2018-08-20 16:18:09 -07:00
Alex Crichton
6343f2659a Remove dependency on wasmi
This is a pretty heavyweight dependency which accounts for a surprising amount
of runtime for larger modules in `wasm-bindgen`. We don't need 90% of the crate
and so this commit bundles a small interpreter for instructions we know are only
going to appear in describe-related functions.
2018-08-20 15:14:56 -07:00