Optimise Array.prototype.slice on arguments objects
Categories
(Core :: JavaScript Engine: JIT, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox101 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(7 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 | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
A while ago I was checking when we fail to scalar replace the arguments
object. I found two common code patterns:
super(...arguments)
(bug 1740737)Array.prototype.slice.call(arguments)
Optimising Array.prototype.slice.call(arguments)
was blocked on bug 1738413, so now we can finally tackle this issue.
Assignee | ||
Comment 1•2 years ago
|
||
The next patches will add Warp and scalar replacement support. The tests are based
on the existing arguments
objects tests and cover the following cases:
- begin and end index are both missing,
- begin index is positive,
- begin index is negative,
- begin and end index are both present.
Assignee | ||
Comment 2•2 years ago
|
||
Transpile "ArgumentsSliceResult" similar to how "PackedArraySliceResult" is
optimised.
Depends on D144041
Assignee | ||
Comment 3•2 years ago
|
||
Adds support to scalar replace MArgumentsSlice
for frame arguments. The next
patch will add support for inlined arguments.
Depends on D144042
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D144043
Assignee | ||
Comment 5•2 years ago
|
||
This change ensures the MMinMax
nodes added in part 3 can be folded away.
Depends on D144044
Assignee | ||
Comment 6•2 years ago
|
||
There used to be multiple callers to emitRest()
(bug 867471), but now
there's only a single caller, so we can inline it again.
Depends on D144047
Assignee | ||
Comment 7•2 years ago
|
||
This is the case which actually happens in practice and we should aim to
provide support for.
Depends on D144048
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/ba4b24512db8 Part 1: Add CacheIR support for Array.prototype.slice on arguments objects. r=iain https://hg.mozilla.org/integration/autoland/rev/aeb3d90e0434 Part 2: Transpile ArgumentsSliceResult for Warp. r=iain https://hg.mozilla.org/integration/autoland/rev/b037127d38f3 Part 3: Scalar replace ArgumentsSlice on frame arguments. r=iain https://hg.mozilla.org/integration/autoland/rev/4676e18c3cf0 Part 4: Scalar replace ArgumentsSlice on inline arguments. r=iain https://hg.mozilla.org/integration/autoland/rev/1e2bfa74a88e Part 5: Teach MMinMax that ArgumentsLength is never negative. r=iain https://hg.mozilla.org/integration/autoland/rev/257207e109b2 Part 6: Inline CodeGenerator::emitRest(). r=iain https://hg.mozilla.org/integration/autoland/rev/201252c849f4 Part 7: Optimise slice when no end-index is present. r=iain
Comment 9•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ba4b24512db8
https://hg.mozilla.org/mozilla-central/rev/aeb3d90e0434
https://hg.mozilla.org/mozilla-central/rev/b037127d38f3
https://hg.mozilla.org/mozilla-central/rev/4676e18c3cf0
https://hg.mozilla.org/mozilla-central/rev/1e2bfa74a88e
https://hg.mozilla.org/mozilla-central/rev/257207e109b2
https://hg.mozilla.org/mozilla-central/rev/201252c849f4
Updated•2 years ago
|
Description
•