Clean-up some code for destructuring bytecode and paren-free arrow parsing
Categories
(Core :: JavaScript Engine, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox106 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(10 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 | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Assignee | ||
Comment 1•2 years ago
|
||
This shaves off one byte in byte code size:
dis(function(){ [...a] = [] })
Before:
00092: 27 True # [] []Symbol.iterator.next []Symbol.iterator [] true
00093: 27 Unpick 1 # [] []Symbol.iterator.next []Symbol.iterator true []
00095: 27 TryDestructuring # [] []Symbol.iterator.next []Symbol.iterator true []
After:
00092: 1 True # [] []Symbol.iterator.next []Symbol.iterator [] true
00093: 1 Swap # [] []Symbol.iterator.next []Symbol.iterator true []
00094: 1 TryDestructuring # [] []Symbol.iterator.next []Symbol.iterator true []
Assignee | ||
Comment 2•2 years ago
|
||
Directly pass lhs
to emitSetOrInitializeDestructuring()
.
Part 6 will further align Object and Array destructuring code.
Depends on D155850
Assignee | ||
Comment 3•2 years ago
|
||
The property is most likely a normal property key and not a number, so let's
handle the normal property key case first.
Depends on D155851
Assignee | ||
Comment 4•2 years ago
|
||
BigInt property keys are parsed as synthetic computed properties, so these
cases no longer apply.
Depends on D155852
Assignee | ||
Comment 5•2 years ago
|
||
Similar to part 3.
Depends on D155853
Assignee | ||
Comment 6•2 years ago
|
||
emitDestructuringLHSRef()
and emitSetOrInitializeDestructuring()
no longer
need to inspect target
to handle spread and assignment expressions when we
directly pass the unpacked parse nodes.
Depends on D155854
Assignee | ||
Comment 7•2 years ago
|
||
Instead of branching around parenFreeArrow
in multiple places, handle the
paren-free arrow function case in a separate if-block. This also simplifies
the Token::Modifier
handling, because we can always pass a constant.
Depends on D155855
Assignee | ||
Comment 8•2 years ago
|
||
TokenStreamPosition
no longer contains GC things.
Depends on D155856
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D155857
Assignee | ||
Comment 10•2 years ago
|
||
There isn't a good reason to keep a simple while
loop in a separate function.
Depends on D155858
Comment 11•2 years ago
|
||
Comment 12•2 years ago
|
||
Backed out for causing build bustages on BytecodeEmitter.cpp
Failure line: /builds/worker/checkouts/gecko/js/src/frontend/BytecodeEmitter.cpp:2635:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
Assignee | ||
Comment 13•2 years ago
|
||
Sigh. Why does linux64 (opt and debug) don't have --enable-warnings-as-errors
?
Comment 14•2 years ago
|
||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 15•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eba6980e67ff
https://hg.mozilla.org/mozilla-central/rev/89b1c584ae8e
https://hg.mozilla.org/mozilla-central/rev/a05af0c15ace
https://hg.mozilla.org/mozilla-central/rev/4a19790129b7
https://hg.mozilla.org/mozilla-central/rev/28622fa10a79
https://hg.mozilla.org/mozilla-central/rev/5cbe09ca8c43
https://hg.mozilla.org/mozilla-central/rev/782ce39e8d24
https://hg.mozilla.org/mozilla-central/rev/6a84be70015e
https://hg.mozilla.org/mozilla-central/rev/412ef9eb0609
https://hg.mozilla.org/mozilla-central/rev/b267528cb51a
Description
•