This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Support Wasm EH + Wasm SjLj
ClosedPublic

Authored by aheejin on Jan 18 2022, 2:31 PM.

Details

Summary

D108960 added support for SjLj using Wasm EH instructions, which we call
Wasm SjLj going forward. (We call the old SjLj Emscripten SjLj) But it
did not support using Wasm EH and Wasm SjLj together. So far users of
Wasm EH had to use Wasm EH with Emscripten SjLj, which had a certain
limitation and it suffered from bigger code size increases as well.

This enables using Wasm EH and Wasm SjLj together.

  1. This redirects catchswitch and cleanupret that unwind to caller to catch.dispatch.longjmp BB, which is a catchswitch BB that handles longjmps.
  2. D108960 converted all longjmpable calls to invokes that unwind to catch.dispatch.longjmp. This CL checks if the call is embedded within another catchpad, and if so, makes it unwind to its nearest parent's unwind destination, rather than catch.dispatch.longjmp. This is necessary to preserve the scoping structure.

Diff Detail

Event Timeline

aheejin created this revision.Jan 18 2022, 2:31 PM
aheejin requested review of this revision.Jan 18 2022, 2:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2022, 2:31 PM
aheejin updated this revision to Diff 400991.Jan 18 2022, 2:32 PM

clang-format

dschuff accepted this revision.Jan 18 2022, 5:45 PM
This revision is now accepted and ready to land.Jan 18 2022, 5:45 PM
This revision was automatically updated to reflect the committed changes.