Merged
Conversation
Owner
saghul
commented
Mar 9, 2026
- wasm: implement WebAssembly.Memory
- wasm: refactor function calling and fix memory grow error
- wasm: add WebAssembly.Global
- wasm: add function import support
- wasm: add externref, funcref, Table, and validate() support
Extract tjs__call_wasm_func_inst() helper from tjs_wasm_callfunction() for reusable WASM function invocation. Use JS_ThrowRangeError directly for memory grow failures instead of generic tjs_throw_wasm_error.
Implement function imports from JS into WASM modules using WAMR's
raw native registration API. Modules are loaded with deferred symbol
resolution (no_resolve), JS callbacks are registered as native
trampolines grouped by module name, then resolved before instantiation.
- Import trampoline bridges WAMR native calls to JS functions
(i32/i64/f32/f64 params and returns)
- JS exceptions from imported functions are preserved and re-thrown
- Upfront LinkError validation for missing imports
- Module.imports() now returns real import metadata
b3dcd12 to
632ff63
Compare
- externref in function params/returns for exported functions - externref globals (read/write) - externref and funcref tables via WebAssembly.Table API - Table exports on Instance - WebAssembly.validate() NOTE: externref in imported functions is not supported due to two apparent WAMR bugs in invoke_native_raw (valkind assert for externref, and wrong argv_src offset for externref params).
632ff63 to
f552802
Compare
This was referenced Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.