-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start to add support for new version of exception handling proposal #152
Start to add support for new version of exception handling proposal #152
Conversation
Is it possible to update tests (instead of disabling them)? Do you know what is a timeline to change LLVM and other tooling to match a new spec? |
I think there's some CI failures as well, but otherwise looks great, thanks! |
af3e961
to
a608502
Compare
I believe I've fixed the CI issues with a push earlier today, but it appears that the Github CI infra is having some trouble right now so it might take a bit for this to show up. @yurydelendik Since the tests are in wabt, I think to update them I'd have to go update the wabt implementation as well (which would be nice to do but wasn't on my critical path at the moment). Re: other tooling, I'm not sure. So far I don't think wabt, binaryen, or LLVM have switched over to the new proposal yet. |
a608502
to
9e81c84
Compare
I've rebased and pushed again so it merges cleanly on top of #154, and CI should be good too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thanks! Just one small stylistic nit
The exception handling proposal switched its design from an exnref-based approach with first-class exception reference values to a version with tagged catch blocks and implicit exception references. This commit adds support for this new semantics and revises tests to match. It does not yet remove exnref, as that can be done in a separate patch. Note: it does not add the `delegate` instruction in the new proposal yet, as it does not yet have an opcode assigned.
9e81c84
to
f810d09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurydelendik do you want to review as well?
Hi just wanted to give a friendly ping to see if there's anything else I should address on this. BTW, should I also add a commit to bump crate versions as this adds new AST types? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on wasmparser side too. Thank you for the patch.
Oops sorry didn't see @yurydelendik's approval from earlier! |
Recently the Wasm CG agreed on changing the exception proposal to a different design (due to wanting to accommodate 2-phase exception handling in the future) that doesn't use
exnref
and has tag arguments forcatch
instructions. There are some slides explaining this in this spec issue and a new draft spec explainer.This pull request starts to add support for this in parsing and in validation. Specifically, it adds
catch_all
andunwind
, removesbr_on_exn
, and revisescatch
(new tag argument) andrethrow
(new index argument) to match the new semantics.I'm submitting this PR as I'm also working on adding exceptions support in SpiderMonkey and updated parsing support from the
wast
crate will be helpful for making the SM tests work.This doesn't yet add the new proposed
delegate
instruction (because no opcode has been proposed yet), and also doesn't removeexnref
yet (can be done later in a separate patch).Since other tools like wabt haven't been updated for the new semantics yet, this PR also disables some of those tests (but adds local ones).
Also the new spec isn't final too, so maybe some instructions will keep changing. Happy to follow up with further PRs to keep current.