FastVM / Web49

Web49: WebAssembly Interpeter
MIT License
324 stars 15 forks source link

setjmp support #7

Open calvin2021y opened 1 year ago

calvin2021y commented 1 year ago

There is a lot code require setjmp to build into wasm, emcc support it by build into javascript backend. (and all mainstream browser support setjmp and exception). https://webassembly.org/roadmap/

I can see FastVM use goto every where, maybe microwasm can add setjmp/longjmp support base on goto ?

a lot library don't use exception but require setjmp, add setjmp will allow a lot wasm only run in browser/nodejs work for web49.

ShawSumma commented 1 year ago

Thank you for the issue!

I do plan on supporting longjmp through emcc's ABI and also wasm's standard exceptions. And pull requests are more than welcome 😉.

This is enabled by miniwasm using an explicit stack as opposed to the "native" stack. It should be as trivial as keeping an array of jump back locations and stack depths. Things are kinda broken right now, and need to be fixed first.

I'll keep this issue open so that i can reference it in any commit helping exceptions.