Improve JS type reflection proposal
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: rhunt, Assigned: rhunt)
References
Details
Attachments
(5 files)
Was re-reviewing this code and have some misc fixes.
- OOM handling
- WA.Function constructor has name of 'WasmFunction'
- WA.Table.proto.type returns TableRepr and not RefType
- WA.Function constructor asserts but doesn't check for non-WA.Function input
Assignee | ||
Comment 1•3 years ago
|
||
The name of WA.Function constructor is "WasmFunction", but should
be "Function".
Assignee | ||
Comment 2•3 years ago
|
||
We should report the precise RefType that a table has, not the
flattened TableRepr.
Depends on D125225
Assignee | ||
Comment 3•3 years ago
|
||
The type() method implementations didn't accurately report OOM's
upon allocation failure. A drive by fix was done to make the
ValTypesToArray method idiomatic and return the array instead of
defining it upon a properties array. Some potential rooting issues
were also addressed.
Depends on D125226
Assignee | ||
Comment 4•3 years ago
|
||
The input function to WA.Function is currently restricted to not
be an exported wasm function. This is being debated in the proposal,
but is currently being asserted in our code and so should be checked
for explicitly.
In addition, some OOM checking, standardized naming, and general
cleanup was added to WA.Function.
Depends on D125227
Assignee | ||
Comment 5•3 years ago
|
||
Module.imports/exports gives reflection of the imports and exports
of a module. We had a non-standard .signature property for function
types that is now superseded with the JS-type proposal [1].
The implementation of creating a type object for the various kinds
of definitions had to be refactored to be shared.
[1] https://github.com/WebAssembly/js-types/issues/19
Depends on D125228
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/64e7d6e00c8a wasm: Fix WA.Function constructor name. r=lth https://hg.mozilla.org/integration/autoland/rev/86b39494212e wasm: Fix Table.type method to report type as RefType instead of TableRepr. r=lth https://hg.mozilla.org/integration/autoland/rev/5c3b5a307381 wasm: Fix type() method implementations for OOM safety. r=lth https://hg.mozilla.org/integration/autoland/rev/ff58a6be4b4d wasm: Check input function to WA.Function constructor. r=lth https://hg.mozilla.org/integration/autoland/rev/2bed6e1ca974 wasm: Extend import/export reflection with types. r=lth
Comment 7•3 years ago
|
||
Backed out for causing spidermonkey bustages on WasmJS.cpp
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/83fbc7aed06b wasm: Fix WA.Function constructor name. r=lth https://hg.mozilla.org/integration/autoland/rev/1309f4739dfc wasm: Fix Table.type method to report type as RefType instead of TableRepr. r=lth https://hg.mozilla.org/integration/autoland/rev/c072c96cc349 wasm: Fix type() method implementations for OOM safety. r=lth https://hg.mozilla.org/integration/autoland/rev/435e207844d7 wasm: Check input function to WA.Function constructor. r=lth https://hg.mozilla.org/integration/autoland/rev/91e0c6d26de8 wasm: Extend import/export reflection with types. r=lth
Comment 10•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/83fbc7aed06b
https://hg.mozilla.org/mozilla-central/rev/1309f4739dfc
https://hg.mozilla.org/mozilla-central/rev/c072c96cc349
https://hg.mozilla.org/mozilla-central/rev/435e207844d7
https://hg.mozilla.org/mozilla-central/rev/91e0c6d26de8
Description
•