Skip to content

Update exception handling support to current proposal - #1596

Merged
aheejin merged 4 commits into
WebAssembly:masterfrom
takikawa:new-eh-proposal
Feb 9, 2021
Merged

aheejin merged 4 commits into
WebAssembly:masterfrom
takikawa:new-eh-proposal

Conversation

@takikawa

Copy link
Copy Markdown
Contributor

This PR updates the support of exception handling to the latest proposal (that is compatible with future 2-phase exception handling) described in WebAssembly/exception-handling#137 and WebAssembly/exception-handling#143.

  • Adds back tagged catch $e, catch_all, and rethrow N from a previous version of wabt, but with updates to match the current spec (e.g., catch_all shares an opcode with else, rethrow's depth indexes only catch blocks, etc).
  • Adds unwind and delegate instructions.
  • Removes exnref and br_on_exn.
  • Updates relevant tests.

There are some details that could still change (e.g., maybe how delegate's depth is validated), but I'd be happy to submit further PRs if the spec details change.

@binji binji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for doing this! Sorry for the long delay on review

Comment thread test/dump/try-delegate.txt Resolved
Comment thread test/dump/try-unwind.txt Resolved
  * Restores code for catch, catch_all, and rethrow from a previous
    version of the proposal, modified to match the latest spec.
  * Adds additional tests and modify existing ones.
  * Remove exnref/br_on_exn tests that will start failing.
@dschuff

dschuff commented Feb 8, 2021

Copy link
Copy Markdown
Member

I just noticed (after the discussion in #1604, thanks for pointing it out) that this PR doesn't actually solve the problem that made me notice the opcode problem, (because I was only using the disassembler). Namely wasm-objdump prints opcode 0x5 as else rather than catch-all even in the context of try. Presumably it's just going directly from opcode.def, (which doesn't have catch_all in this PR). But maybe let's not fix this until we decide whether we want to keep the opcodes as they are or change them.

@aheejin

aheejin commented Feb 9, 2021 •

Copy link
Copy Markdown
Member

Thanks @takikawa! By the way can I merge this? If the opcode is the issue we can fix it later.

@takikawa

takikawa commented Feb 9, 2021

Copy link
Copy Markdown
Contributor Author

@aheejin Sure, no issues on my end with having it merged. AFAIK I've addressed all the comments in review. Thanks!

I'd also be happy to submit a PR afterwards if the opcode changes.

@aheejin
aheejin merged commit 036a632 into WebAssembly:master Feb 9, 2021
@takikawa
takikawa deleted the new-eh-proposal branch February 9, 2021 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants