• Michael Starzinger's avatar
    [wasm] Add support for "br_on_exn" in the interpreter. · 46a99b07
    Michael Starzinger authored
    This adds preliminary support for handling the "br_on_exn" opcode in the
    interpreter. It also makes "catch" and "rethrow" use a proper exception
    reference instead of a dummy value.
    
    To that end this also adds {Handle<>} as a new kind of {WasmValue} which
    is intended to pass reference values (e.g. "anyref" or "except_ref") to
    the runtime system. Therefore lifetime of such a {WasmValue} is directly
    coupled to any surrounding {HandleScope}.
    
    For now we just store {Handle<>} directly on the simulated operand stack
    of the interpreter. This is of course bogus, since the surrounding scope
    does not outlive the interpreter activation. Decoupling the lifetime of
    the operand stack from a {HandleScope} will be done in a follow-up CL.
    
    As a drive-by this change also implements support for the "ref_null" and
    the "ref_is_null" opcodes as a proof-of-concept that the new {WasmValue}
    is also applicable to the "anyref" reference type.
    
    R=clemensh@chromium.org
    TEST=cctest/test-run-wasm-interpreter/ReferenceTypeLocals
    BUG=v8:8091,v8:7581
    
    Change-Id: I2307e0689a19c4aab1d67f1ba6742cb3cc31aa3c
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1550299
    Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
    Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#60598}
    46a99b07
wasm-macro-gen.h 34.5 KB