Previously this pass would assume that it was running over the
entire program. This meant it could get away with creating the
two helper functions:
- setThrew
- setTempRet0
Instead we now assume these will be provided at link time. In
emscripten this will most likely be done via libcxxabi.
Additionally we previously created three global variable:
- THREW
- _threwValue
- __tempRet0
These are now allow assumed to be available at link time, but
we also have to handle the case where they exist in the module
being compiled (e.g. when we are doing LTO with libcxxabi).
Because you are gonna provide setThrew and setTempRet0 in a separate cpp file, "their values should be set in JS code" does not strictly sound correct, because that cpp file is gonna be a part of wasm as well. Could you elaborate that these functions will be provided from library that's a part of emscripten?
And for the equivalent asm.js version of JS code below ↓ , I know that's not a part of your change, but I think we can delete this by now, because we are gonna switch to the wasm as a default backend anyway. Maybe show the code in cpp form would be better.