Make Wasm{Struct,Array}Object point directly at their SuperTypeVectors
Categories
(Core :: JavaScript: WebAssembly, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: jseward, Assigned: jseward)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
Currently Wasm{Struct,Array}Object point at their relevant TypeDef, which
in turn points at the associated SuperTypeVector. This causes all references
to the SuperTypeVector -- particularly for casting -- to need a double
indirection. It would be better for these objects to point directly at their
SuperTypeVectors.
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Instance::refTest is no longer ever called; such tests are now (presumably)
generated in-line. This patch removes it and all the supporting machinery
(SASigRefTest, etc) needed to call it. No functional change.
Assignee | ||
Comment 2•2 years ago
|
||
Currently Wasm{Struct,Array}Object point at their relevant TypeDef, which in
turn points at the associated SuperTypeVector. This causes all references to
the SuperTypeVector -- particularly for casting -- to need a double
indirection. This patch makes them point directly at their SuperTypeVectors
instead.
The changes are almost all mechanical. Points of note are:
-
WasmGcObject (hence WSO/WAO) now hold a SuperTypeVector*, not a TypeDef*.
-
SuperTypeVector now holds a TypeDef*; and TypeDef already has a pointer to
its SuperTypeVector. These two must point at each other, so as to form a
1:1 relationship. -
TypeDefInstanceData now has both a SuperTypeVector* and TypeDef*, since both
are needed at run time. -
The point of all the changes is so that
MacroAssembler::branchWasmTypeDefIsSubtype -- now renamed to
::branchWasmSuperTypeVectorIsSubtype -- can omit the load that would chase
from a TypeDef to its SuperTypeVector. However, this routine is also
changed so as to skip the fast-path check for the type defs (as-was) being
equal; profiling suggests it is perf-neutral, and so generating smaller code
seems preferable. -
MinSuperTypeVectorLength has been increased from 3 to 8 following profiling
with Barista-3. jit-test/tests/wasm/gc/casting.js is updated accordingly. -
The example in the comment explaining type vectors in WasmTypeDef.h has been
reworked so as to make it clear that the type numbers have no relationship
to the vector indices (this wasn't clear before). -
SuperTypeVector has been changed from a struct to a class; we seem to mostly
use classes elsewhere, even for objects accessed from generated code.
Depends on D174060
Assignee | ||
Comment 3•2 years ago
|
||
WasmTypeDef.h contains all the key data types for the wasm-gc extension.
These are arranged more or less in a def-before-use ordering, which is good.
But the file is still a bit hard to navigate. This patch adds dividing
comments, and a few in WasmTypeDef.cpp too. No functional change.
Depends on D174061
Comment 5•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9754f151ef66
https://hg.mozilla.org/mozilla-central/rev/10fdad0cb315
https://hg.mozilla.org/mozilla-central/rev/badd00a28e4e
Description
•