Add support for final types in GC proposal
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox117 | --- | fixed |
People
(Reporter: rhunt, Assigned: jpages)
References
Details
Attachments
(2 files)
The GC proposal now supports marking some type definitions as 'final' which means that no type may declare themselves a subtype of that one. [1]
The motivation for this is that when you downcast to a final type, you can just compare the object's type definition directly without doing a full subtype check.
To support this we need:
- Update wasm-tools to parse and encode a final flag
- Add a 'isFinal' flag to wasm::TypeDef
- Don't allow a type to declare a parent type that is final (see TypeDef::canBeSubtypeOf)
- Decode the 'isFinal' flag while reading type definitions (see DecodeTypeSection)
[1] https://github.com/WebAssembly/gc/blob/main/proposals/gc/MVP.md#type-definitions
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 1•3 years ago
|
||
See https://github.com/bytecodealliance/wasm-tools/pull/1043
PR for final types is currently a draft and needs some changes in wasm-tools first: https://phabricator.services.mozilla.com/D178384
| Assignee | ||
Comment 2•3 years ago
|
||
A final type can't have any subtypes. All wasm types
are now final by default unless the sub keyword is used.
To make a type non final use: (type $foo (sub)).
Use final with the following syntax: (type $foo (sub final)).
Updated•3 years ago
|
| Assignee | ||
Comment 3•3 years ago
|
||
Depends on D178384
Comment 5•2 years ago
|
||
Comment 7•2 years ago
|
||
Backed out changeset 7d6d051e0abd (bug 1825088) for causing multiple failures
Backout: https://hg.mozilla.org/integration/autoland/rev/cbbbe12901352ad97e23bfb3d8bc8eb0b142635f
Failure logs:
SM failure: https://treeherder.mozilla.org/logviewer?job_id=420637067&repo=autoland&lineNumber=14177
Jit failure: https://treeherder.mozilla.org/logviewer?job_id=420639027&repo=autoland&lineNumber=45289
Comment 9•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e6b123be310c
https://hg.mozilla.org/mozilla-central/rev/c40b6292592f
| Assignee | ||
Updated•2 years ago
|
Description
•