Implement advanced array construction instructions in baseline
Categories
(Core :: JavaScript: WebAssembly, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: rhunt, Assigned: jseward)
References
Details
Attachments
(8 files)
2.26 KB,
application/x-javascript
|
Details | |
65.17 KB,
patch
|
Details | Diff | Splinter 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 | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The GC proposal has several new instructions since we last updated our implementation:
array.copy
array.init
array.init_static
br_on_non_null
br_on_cast_fail
ref.is_T
ref.br_on_T
ref.br_on_non_T
And possibly more. This bug is just for the work to implement them in baseline (the only compiler we support GC in).
Reporter | ||
Comment 1•1 year ago
•
|
||
We have several new array instructions [1]. We should track the actual proposal here, and not V8's document as the proposal is more up to date here. The one exception is that the proposal still lists these instructions as taking an (rtt) operand. This won't be the case after rtt values are removed.
- array.new_fixed <typeidx> <N> - pops N values from the stack to form an array of N values
- array.new_data <typeidx> <dataidx> - create an array and initialize it from a data segment
- array.new_elem <typeidx> <elemidx> - create an array and initialize it from an elem segment
There is also a V8 only array.copy instruction [2] that we will also need to implement.
- array.copy <typeidx1> <typeidx2> - copies a range from srcArray to destArray
array.new_data/new_elem/copy should all be implemented via instance calls (at least for the baseline compiler). array.new_fixed can use an instance call to create the array, but will need to pop the values itself and store them in the array.
[1] https://github.com/WebAssembly/gc/blob/main/proposals/gc/MVP.md#arrays
[2] https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit#
Reporter | ||
Comment 2•1 year ago
|
||
The new instructions will depend on the the text format being updated in [1]. We'll vendor in this change in bug 1774829.
Reporter | ||
Comment 3•1 year ago
|
||
Here's a roughed-in test file for the new array instructions. There may be some syntax errors, but the essence should be correct.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 4•1 year ago
|
||
WIP patch, first working implementation of array.new_fixed, array.new_data,
array.new_elem and array.copy. Is almost certainly a long way off being fully
correct, in multiple ways.
Assignee | ||
Comment 5•1 year ago
|
||
Part 1 - debug/comment improvements. No functional change.
-
Add a debug-only method BaseCompiler::showStack, to dump the compiler's
value stack to stderr. -
Add comment describing argument-handling in BaseCompiler::emitInstanceCall.
Assignee | ||
Comment 6•1 year ago
|
||
In the existing GC array implementation, change some names that are length
or elementsLength
to be numElements
, to remove ambiguity about whether
those quantities are "number of bytes" or "number of array elements". No
functional change.
Depends on D154228
Assignee | ||
Comment 7•1 year ago
|
||
Adds wasm baseline implementation and test cases for array.new_fixed
.
Depends on D154229
Assignee | ||
Comment 8•1 year ago
|
||
Adds wasm baseline implementation and test cases for array.new_data
.
Depends on D154230
Assignee | ||
Comment 9•1 year ago
|
||
Adds wasm baseline implementation and test cases for array.new_elem
.
Depends on D154231
Assignee | ||
Comment 10•1 year ago
|
||
Adds wasm baseline implementation and test cases for array.new_copy
.
Depends on D154232
Reporter | ||
Updated•1 year ago
|
Reporter | ||
Updated•1 year ago
|
Comment 11•1 year ago
|
||
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/da4e5d8fb7e9 Implement new GC instructions in baseline (Part 1). r=rhunt. https://hg.mozilla.org/integration/autoland/rev/2c7fcebf117c Implement new GC instructions in baseline (Part 2). r=rhunt. https://hg.mozilla.org/integration/autoland/rev/976cd7902cb5 Implement new GC instructions in baseline (Part 3). r=rhunt.
Assignee | ||
Updated•1 year ago
|
Comment 12•1 year ago
|
||
bugherder |
Comment 13•1 year ago
|
||
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dad36378291b Implement new GC instructions in baseline (Part 4). r=rhunt. https://hg.mozilla.org/integration/autoland/rev/31aa38a5e2fc Implement new GC instructions in baseline (Part 5). r=rhunt.
Comment 14•1 year ago
|
||
bugherder |
Comment 15•1 year ago
|
||
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8b27b90ec991 Implement new GC instructions in baseline (Part 6). r=rhunt.
Assignee | ||
Updated•1 year ago
|
Comment 16•1 year ago
|
||
bugherder |
Description
•