Closed Bug 1803043 Opened 6 months ago Closed 6 months ago

Implement remaining instructions for wasm-gc via Ion


(Core :: JavaScript: WebAssembly, enhancement)




109 Branch
Tracking Status
firefox109 --- fixed


(Reporter: jseward, Assigned: jseward)


(Blocks 2 open bugs)



(1 file)

Bug 1797933 implemented various wasm-gc struct insns via Ion, and bug 1799856
implements various array insns. This bug is for implementation of all
remaining un-implemented insns, which are believed to be:

  br_on_cast           br_on_cast_fail
  extern.internalize   extern.externalize
  ref.eq               ref.test

This patch implements the following instructions for wasm-gc via Ion:

  • struct.new_default (mistakenly omitted from bug 1797933)

  • br_on_cast, br_on_cast_fail

  • extern.internalize, extern.externalize

  • ref.eq, ref.test

These are all pretty straightforwardly derived from their baseline
equivalents. Changes:

  • many test cases: remove the guard || wasmCompileMode().includes("ion")

  • tests/wasm/gc/br-on-cast{,-fail}.js: add another test that seems necessary
    given the Ion implementation of these

  • class MTest: remove a trivial constructor-wrapper for the case trueBranch
    being null, since that makes it impossible to create another wrapper for the
    case falseBranch being null (they would have the same signature). Fix up
    the (very few) use points accordingly.

  • new routines FunctionCompiler::refTest, ::brOnCastCommon, to generate MIR
    for those insns.

  • new routines EmitStructNewDefault, EmitRefTest, EmitBrOnCastCommon,
    EmitExternInternalize, EmitExternExternalize.

  • for the existing implementation of ref.eq, change the expected argument
    type from RefType::extern_() to RefType::eq(). This makes it consistent
    with the baseline implementation; without that some test cases are
    incorrectly rejected by validation.

Pushed by
Implement remaining instructions for wasm-gc via Ion.  r=rhunt.
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.