-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
pulleyIssues related to the Pulley interpreterIssues related to the Pulley interpreterwasm-proposal:exceptionsIssues for WebAssembly exceptions/exception-handlingIssues for WebAssembly exceptions/exception-handling
Description
The exception-handling support as implemented in #11326 does not yet support Pulley. It is almost there, but not quite:
- Pulley's use of Cranelift for code generation means that we do get exception metadata alongside Pulley bytecode, and a module that uses exceptions can be compiled;
- The support for stack-walking of Pulley stacks means that the exception unwinder can find handlers in Pulley code;
- However, the
raiselibcall implementation that Pulley uses does not account forUnwindState::UnwindToWasm. This means that we'll reach host-to-Wasm entry instead, with an unexpected unwind state, and panic.
In this comment I outline an alternative approach: we should
- invoke the real
raiselibcall, just as we do other libcalls, from Pulley; - when we enter
unwind, and eitherwasmtime_longjmp()orwasmtime_unwinder::resume_to_exception_handler(), we instead check the store's executor and- on native code, do as we do today
- on Pulley, update the Pulley interpreter state appropriately
Metadata
Metadata
Assignees
Labels
pulleyIssues related to the Pulley interpreterIssues related to the Pulley interpreterwasm-proposal:exceptionsIssues for WebAssembly exceptions/exception-handlingIssues for WebAssembly exceptions/exception-handling