ToValType support for GC types is non-standard
Categories
(Core :: JavaScript: WebAssembly, task, P2)
Tracking
()
| 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.
| Reporter | ||
Comment 1•2 years ago
|
||
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).
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 2•2 years ago
|
||
| Reporter | ||
Comment 3•2 years ago
|
||
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.
| Assignee | ||
Comment 4•2 years ago
|
||
Description
•