Add support for GC type eqref
Categories
(Core :: JavaScript: WebAssembly, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox83 | --- | fixed |
People
(Reporter: volker.berlin, Assigned: rhunt)
References
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
Steps to reproduce:
I try to use eqref
from the M2 of the GC prototype. I compile the follow code with the function wasmTextToBinary:
(module
(func $test(local $val eqref)
)
)
And then I try to instanciate it with WebAssembly.instantiate
. I run the script with js --wasm-gc test.js
Actual results:
The text is compiled but the binary was not loaded. I receive:
CompileError: wasm validation error: at offset 25: bad type
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
I have patches for this after bug 1669784.
Assignee | ||
Comment 2•4 years ago
|
||
This commit adds support for the eqref value type. It shares the same
representation as externref, with the restriction that all values must
be TypedObject's. Dynamic type checks similar to funcref are added to
stubs.
As fallout from anyref removal, struct types were left as subtypes of
externref. This commit switches them to be subtypes of eqref.
As a small tweak, the ordering on cases when switching on refTypeKind()
were standardized to binary order (i.e. funcref, externref, eqref).
I think we can refactor some code to simplify the process of adding
new reftypes and would like to do that in the future.
Assignee | ||
Comment 3•4 years ago
|
||
Give ref.eq type of [eqref, eqref] : [i32], closing a corner case where boxed
JS values could be compared for equality.
Restrict struct.narrow to operate on eqref, as that's the super type of structs.
This also allows us to drop an unboxing from externref -> typed object as that
is now done in all wasm entries.
Depends on D93000
Assignee | ||
Comment 4•4 years ago
|
||
The existing gc tests relied on struct <: externref in various ways,
this commit fixes this.
Additionally a new test is added for checking we have dynamic tests
for eqref on all wasm value entry points.
Depends on D93001
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/8a41359f69f9 wasm: Implement eqref. r=lth https://hg.mozilla.org/integration/autoland/rev/b8c11e84c63e wasm: Refine struct.narrow and ref.eq to use eqref input types. r=lth https://hg.mozilla.org/integration/autoland/rev/2d25e9f9b077 wasm: Fix tests and add new one for eqref. r=lth
Comment 6•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8a41359f69f9
https://hg.mozilla.org/mozilla-central/rev/b8c11e84c63e
https://hg.mozilla.org/mozilla-central/rev/2d25e9f9b077
Description
•