mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 22:41:24 +00:00
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!
This commit is contained in:
@ -194,6 +194,7 @@ impl Bindgen {
|
||||
memory_init: None,
|
||||
imported_functions: Default::default(),
|
||||
imported_statics: Default::default(),
|
||||
direct_imports: Default::default(),
|
||||
};
|
||||
for program in programs.iter() {
|
||||
js::SubContext {
|
||||
|
Reference in New Issue
Block a user