Closed Bug 1871146 Opened 2 years ago Closed 2 years ago

ToValType support for GC types is non-standard

Categories

(Core :: JavaScript: WebAssembly, task, P2)

task

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: rhunt, Assigned: jpages)

References

Details

Attachments

(1 file)

The JS-API for the GC proposal was not extended to support 'anyref' and others for ToValType. We implemented all the GC heap type shorthands plus a form for non-nullable types. V8 also implemented some of the GC heap type shorthands. This is being discussed upstream in (https://github.com/WebAssembly/gc/issues/500). We should probably unship our support for the non-nullable types at a minimum.

As a first step, let's remove support for parsing objects into 'reftype' by removing MaybeToRefType [1]. I'm not sure if we use this in tests or not, if we do we'll need to find a workaround.

The easiest way to test this is to use the Global JS-API: new WebAssembly.Global({value: V, mutable: true}, initialValue).

[1] https://searchfox.org/mozilla-central/rev/3c72de9280ec57dc55c24886c6334d9e340500e8/js/src/wasm/WasmValType.cpp#153

Assignee: nobody → jpages

The reftype-parse.js tests you link to can be removed, as they're only really testing that this functionality exists.

The non-nullable-table.js tests are a little trickier. I think the simplest thing would be to change from:

let x = new WebAssembly.Table({initial: X, element: { ... }});

To:

let x = new wasmEvalText(`(module (table (export "x") ${elementType} ${initialValue}))`).exports.x;

My table syntax might not be right, but basically instantiate a module that defines and exports a table with the non-nullable reference type in it. This should do the same thing as the JS-API table constructor.

Pushed by jpages@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5e82ea558f45 wasm: Unship the support for non-nullable types in the JS-API. r=rhunt
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: