Collect type definitions referenced by wasm-GC objects
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox94 | --- | fixed |
People
(Reporter: rhunt, Assigned: rhunt)
References
Details
Attachments
(6 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Currently we allocate GC type definitions in a JSContext global TypeContext per instantiation. Then when we allocate GC objects for that instance, we use an index into the JSContext global TypeContext for the RttValue. This scheme is easy to implement but doesn't allow the type definitions to ever be freed.
Assignee | ||
Comment 1•3 years ago
|
||
Driveby fix to use a more descriptive 'subtype' 'supertype' naming
scheme for the subtype algorithm and tests. Equivalence testing
is changed to first/second as well.
Assignee | ||
Comment 2•3 years ago
|
||
This commit makes TypeContext refcounted/shareable. This is so that
we can change RttValue's representation to be:
- RefPtr<TypeContext> typeContext;
- uint32_t typeIndex;
Effectively adding an explicit type context field to RttValue instead
of using an implicit global TypeContext, as it is now.
The big change here is that as TypeContext is now refcounted, it
needs to be heap-allocated, and cannot be a plain member of
ModuleEnvironment, as it is now. This adds some extra indirections.
If this is unacceptable, then I think we can find a workaround.
The next commit will implement the changes to RttValue.
Depends on D125888
Assignee | ||
Comment 3•3 years ago
|
||
Drop the global type context from WasmContext. RttValue's now hold
a strong reference to their TypeContext which they can use with their
pre-existing type index to get their type definition.
Depends on D125889
Assignee | ||
Comment 4•3 years ago
|
||
RttValue::Size,Kind were required when a JSContext* was needed to
access the TypeDef object. This is no longer a requirement and so we
can just directly get those fields.
Depends on D125890
Assignee | ||
Comment 5•3 years ago
|
||
While we're at it, let's remove the TypedProto slot as well. This is
currently unused and unlikely to match whatever is decided upon for
the MVP JS-API.
Depends on D125891
Assignee | ||
Comment 6•3 years ago
|
||
The direct pointer to TypeDef* is needed far more often, and can be used to
map back to the index whenever required.
Depends on D125892
Pushed by rhunt@eqrion.net: https://hg.mozilla.org/integration/autoland/rev/3137f58698a4 wasm: Use better names in subtype algorithms. r=lth https://hg.mozilla.org/integration/autoland/rev/7b2661dfc414 wasm: Make TypeContext refcounted and shareable. r=lth https://hg.mozilla.org/integration/autoland/rev/7ce33df6f26d wasm: Drop implicit global type context and refer to explicit TypeContext in RttValue. r=lth https://hg.mozilla.org/integration/autoland/rev/819092ae2815 wasm: Drop duplicated slots no longer needed. r=lth https://hg.mozilla.org/integration/autoland/rev/743c6ee17c28 wasm: Drop TypedProto. r=lth https://hg.mozilla.org/integration/autoland/rev/959de44518b1 wasm: Store raw pointer to TypeDef instead of index in RttValue. r=lth
Comment 8•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3137f58698a4
https://hg.mozilla.org/mozilla-central/rev/7b2661dfc414
https://hg.mozilla.org/mozilla-central/rev/7ce33df6f26d
https://hg.mozilla.org/mozilla-central/rev/819092ae2815
https://hg.mozilla.org/mozilla-central/rev/743c6ee17c28
https://hg.mozilla.org/mozilla-central/rev/959de44518b1
Description
•