This add support for SjLj using Wasm exception handling instructions:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/exception-handling/Exceptions.md
This does not yet support the mixed use of EH and SjLj within a
function. It will be added in a follow-up CL.
This currently passes all SjLj Emscripten tests for wasm0/1/2/3/s,
except for the below:
- test_longjmp_standalone: Uses Node
- test_dlfcn_longjmp: Uses NodeRAWFS
- test_longjmp_throw: Mixes EH and SjLj
- test_exceptions_longjmp1: Mixes EH and SjLj
- test_exceptions_longjmp2: Mixes EH and SjLj
- test_exceptions_longjmp3: Mixes EH and SjLj
Eventually it might be nice to make it possible to use wasm SJLJ without needing emscripten, which should be feasible since it doesn't need JS. I guess that would mean moving or copying some library functions out of emscripten proper, and maybe refactoring the code or something. It doesn't have to be soon though.