Skip to content

Exceptions: support Pulley #11486

@cfallin

Description

@cfallin

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 raise libcall implementation that Pulley uses does not account for UnwindState::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 raise libcall, just as we do other libcalls, from Pulley;
  • when we enter unwind, and either wasmtime_longjmp() or wasmtime_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

No one assigned

    Labels

    pulleyIssues related to the Pulley interpreterwasm-proposal:exceptionsIssues for WebAssembly exceptions/exception-handling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions