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•3 years 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•3 years 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•3 years 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•3 years ago
|
Assignee | ||
Comment 4•3 years 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•2 years 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•2 years 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•2 years ago
|
||
Adds wasm baseline implementation and test cases for array.new_fixed
.
Depends on D154229
Assignee | ||
Comment 8•2 years ago
|
||
Adds wasm baseline implementation and test cases for array.new_data
.
Depends on D154230
Assignee | ||
Comment 9•2 years ago
|
||
Adds wasm baseline implementation and test cases for array.new_elem
.
Depends on D154231
Assignee | ||
Comment 10•2 years ago
|
||
Adds wasm baseline implementation and test cases for array.new_copy
.
Depends on D154232
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Updated•2 years ago
|
Comment 11•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Comment 12•2 years ago
|
||
bugherder |
Comment 13•2 years ago
|
||
Comment 14•2 years ago
|
||
bugherder |
Comment 15•2 years ago
|
||
Assignee | ||
Updated•2 years ago
|
Comment 16•2 years ago
|
||
bugherder |
Description
•