wasm-bindgen/tests/wasm
Alex Crichton 68537b9649 Add an optimization to directly wire up imported functions
This commit adds an optimization to `wasm-bindgen` to directly import
and invoke other modules' functions from the wasm module, rather than
going through a shim in the imported bindings. This will be an important
optimization in the future for the host bindings proposal, but for now
it's largely just a proof-of-concept to show that we can do it and is
unlikely to bring about many performance benefits.

The implementation in this commit is largely refactoring to reorganize a
bit how functions are imported, but the implementation happens in
`generate_import_function`.

With this commit, 71/287 imports in the `tests/wasm/main.rs` suite get
hooked up directly to the ES modules, no shims needed!
2018-11-13 13:16:38 -08:00
..
api.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
api.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
char.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
char.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
classes.js Only emit JS glue assertions for move arguments in debug mode 2018-11-08 15:08:46 -08:00
classes.rs Implement support for js_class on exported types 2018-11-05 12:29:14 -08:00
closures.js Improve codegen for Closure<T> 2018-09-29 07:00:53 -07:00
closures.rs Improve codegen for Closure<T> 2018-09-29 07:00:53 -07:00
comments.js Move comments test to wasm 2018-08-06 11:46:23 -07:00
comments.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
duplicate_deps.js Migrate rest of dependencies test to wasm 2018-08-06 10:42:08 -07:00
duplicate_deps.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
duplicates_a.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates_b.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates_c.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
enums.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
enums.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
final.js Rename host_binding to final 2018-11-09 08:00:41 -08:00
final.rs Rename host_binding to final 2018-11-09 08:00:41 -08:00
import_class.js Fix tagging static methods as structural 2018-11-08 11:50:34 -08:00
import_class.rs Rename host_binding to final 2018-11-09 08:00:41 -08:00
imports.js Fix generated shims if APIs don't exist 2018-10-10 17:46:51 -07:00
imports.rs Fix generated shims if APIs don't exist 2018-10-10 17:46:51 -07:00
js_objects.js Migrate the serde-serialize test to wasm 2018-08-06 09:43:55 -07:00
js_objects.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
jscast.js Implement #[wasm_bindgen(extends = ...)] 2018-08-07 13:04:11 -07:00
jscast.rs Parse Paths in extends attributes 2018-10-03 09:14:23 -07:00
main.rs Rename host_binding to final 2018-11-09 08:00:41 -08:00
math.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
math.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
node.js Move node test over to wasm 2018-08-06 10:06:45 -07:00
node.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
option.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
option.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
optional_primitives.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
optional_primitives.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
rethrow.js Allow returning Result from functions 2018-09-18 13:13:59 -07:00
rethrow.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
simple.js Use the JS name of an imported type for instanceof checks 2018-08-08 14:42:21 -07:00
simple.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
slice.js Implement support for Uint8ClampedArray 2018-09-24 13:58:37 -07:00
slice.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
structural.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
structural.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
u64.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
u64.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
validate_prt.js Only generate JS null checks in debug mode 2018-09-21 16:10:02 -07:00
validate_prt.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
variadic.js Add docs and remove typecheck from variadic attribute 2018-09-01 13:55:35 +01:00
variadic.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
vendor_prefix.js Rename polyfill to vendor_prefix 2018-10-01 14:45:30 -07:00
vendor_prefix.rs Add an optimization to directly wire up imported functions 2018-11-13 13:16:38 -08:00