Bug 1695778 - (Core-Wasm-EH-Ion) part 4: Support reftypes in exceptions. r=rhunt
commit05b8eae0d7445226835acc24ab2ca198bd33e825
authorIoanna Dimitriou <idimitriou@igalia.com>
Tue, 21 Dec 2021 02:28:48 +0000 (21 02:28 +0000)
committerIoanna Dimitriou <idimitriou@igalia.com>
Tue, 21 Dec 2021 02:28:48 +0000 (21 02:28 +0000)
tree2b0d59ef8bb0d634bebba15fbf5726e61b373e0e
parent3858fa164f538b94f3e8385df990c847907e5de5
Bug 1695778 - (Core-Wasm-EH-Ion) part 4: Support reftypes in exceptions. r=rhunt

This patch concludes support for the WebAssembly Exception Handling proposal.

Spec: https://github.com/WebAssembly/exception-handling

Changes:

- Mirroring the Baseline approach, and the Ion approach for numeric values,
  this patch adds two MIR and LIR nodes:
  - WasmExceptionRefsPointer to get a pointer to the ArrayObject REFS of a
    WasmExceptionObject, and
  - WasmLoadExceptionRefsValue to get a RefOrNull value from a
    WasmExceptionRefsPointer
- Storing a RefOrNull value in the exception is done via the instance call
  SASigPushRefIntoExn. Since this pushes the value in the Refs Array, we
  iterate backwards.
- The above mentioned instance call is changed to follow this review
  comment on part 1 of this patchset:
  https://phabricator.services.mozilla.com/D118283#inline-716841
- Enables all tests in .../wasm/exceptions/, and adds reftypes in some
  existing tests.

Differential Revision: https://phabricator.services.mozilla.com/D132637
12 files changed:
js/src/jit-test/tests/wasm/exceptions/calls.js
js/src/jit-test/tests/wasm/exceptions/js-api.js
js/src/jit-test/tests/wasm/exceptions/reftypes.js
js/src/jit/CodeGenerator.cpp
js/src/jit/LIROps.yaml
js/src/jit/Lowering.cpp
js/src/jit/MIR.h
js/src/jit/MIROps.yaml
js/src/jit/shared/LIR-shared.h
js/src/wasm/WasmBaselineCompile.cpp
js/src/wasm/WasmBuiltins.cpp
js/src/wasm/WasmIonCompile.cpp