Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Description
There is a WIP proposal to enable webassembly stack switching which have been implemented in v8.
https://github.com/WebAssembly/js-promise-integration
It is not possible to switch stacks that contain JS frames so the Emscripten JS trampolines that allow calling functions with the wrong number of arguments don't work in this case. However, the js-promise-integration proposal requires thetype reflection for Wasm/JS API proposal, which allows us to actually count the number of arguments a function expects. I propose that for better compatibility with stack switching, we check if type reflection is available, and if so we use a switch block to decide the appropriate signature. If type reflection is unavailable, we should use the current EMJS trampoline.
I'm working on a patch for this.