Emscripten SjLj and (soon-to-be-added) Wasm SjLj transformation share
many steps:
- Initialize setjmpTable and setjmpTableSize in the entry BB
- Handle setjmp callsites
- Handle longjmp callsites
- Cleanup and update SSA
1, 3, and 4 are identical for Emscripten SjLj and Wasm SjLj. Only the
step 2 is different. This CL extracts the current Emscripten SjLj's
longjmp callsites handling into a function. The reason to make this a
separate CL is, without this, the diff tool cannot compare things well
in the presence of moved code and added code in the followup Wasm SjLj
CL, and it ends up mixing them together, making the diff unreadable.
Also fixes some typos and variable names. So far we've been calling the
buffer argument to setjmp and longjmp jmpbuf, but the name used in
the man page for those functions is env, so updated them to be
consistent.
Is wasm_landingpad_context the same as wasm_lpad_context above? Should those names be consistent?