-
Notifications
You must be signed in to change notification settings - Fork 831
Update interpreter for new EH spec #3498
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
Conversation
|
Currently the EH spec test fails on |
| WASM_UNREACHABLE("rethrow"); | ||
| */ | ||
| } | ||
| Flow visitRethrow(Rethrow* curr) { WASM_UNREACHABLE("unimp"); } |
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.
This was moved to RuntimeExpressionRunner, because not rethrow needs an access to the exception stack.
This updates the interpreter for the EH instructions (modulo `delegate`) to match the new spec. Before we had an `exnref` type so threw a `Literal` of `exnref` type which contained `ExceptionPackage`. But now that we don't have `exnref` anymore, so we add the contents of `ExceptionPackage` to `WasmException`, which is used only for the `ExpressionRunner` class hierarchy. `exnref` and `ExceptionPackage` will be removed in a followup CL. This allows nonzero depths for `rethrow` for now for testing; we disallowed that for safety measure, but given that there are no passes that modifies that field, I think the risk is low.
c88869a to
a5c6615
Compare
kripken
left a comment
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.
Nice, the rethrowing adds some complexity, but otherwise this is pretty simple and neat.
src/wasm-interpreter.h
Outdated
| } | ||
| // This exception is not caught by this try-catch. Rethrow it. | ||
| throw; | ||
| WASM_UNREACHABLE("try"); |
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.
is this WASM_UNREACHABLE still needed?
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.
I guess not. Thanks. Removed.
|
By the way my latest commit title should be not "Remove the unnecessary |
This updates the interpreter for the EH instructions (modulo
delegate)to match the new spec. Before we had an
exnreftype so threw aLiteralofexnreftype which containedExceptionPackage. But nowthat we don't have
exnrefanymore, so we add the contents ofExceptionPackagetoWasmException, which is used only for theExpressionRunnerclass hierarchy.exnrefandExceptionPackagewillbe removed in a followup CL.
This allows nonzero depths for
rethrowfor now for testing; wedisallowed that for safety measure, but given that there are no passes
that modifies that field, I think the risk is low.