Closed Bug 1803043 Opened 1 year ago Closed 1 year ago

Implement remaining instructions for wasm-gc via Ion

Categories

(Core :: JavaScript: WebAssembly, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: jseward, Assigned: jseward)

References

(Blocks 2 open bugs)

Details

Attachments

(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
  struct.new_default

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 jseward@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d83f51f4f606
Implement remaining instructions for wasm-gc via Ion.  r=rhunt.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: