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
|
||
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/5e9c66da7409 Part 1: Prefer BytecodeEmitter::emitUnpickN() over JSOp::Unpick. r=arai https://hg.mozilla.org/integration/autoland/rev/f5e5764cc4d3 Part 2: Directly pass 'lhs' to emitSetOrInitializeDestructuring. r=arai https://hg.mozilla.org/integration/autoland/rev/b495ed555e0d Part 3: Reorder access in destructuring so most likely cases come first. r=arai https://hg.mozilla.org/integration/autoland/rev/39525ff15d29 Part 4: Remove unreachable code for BigInt property keys. r=arai https://hg.mozilla.org/integration/autoland/rev/4abc0092802a Part 5: Reorder more property name operations to handle simple names first. r=arai https://hg.mozilla.org/integration/autoland/rev/71436fb16132 Part 6: Align Array and Object destructuring code paths. r=arai https://hg.mozilla.org/integration/autoland/rev/cd0dd29a5c65 Part 7: Simplify paren-free arrow function parsing. r=arai https://hg.mozilla.org/integration/autoland/rev/8fbfb862f801 Part 8: Remove a stale comment. r=arai https://hg.mozilla.org/integration/autoland/rev/ee76c50ba4b7 Part 9: Remove unused NumericLiteral setters. r=arai https://hg.mozilla.org/integration/autoland/rev/2a4095902192 Part 10: Inline literalIsZeroNoRadix into its single caller. r=arai
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
|
||
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/eba6980e67ff Part 1: Prefer BytecodeEmitter::emitUnpickN() over JSOp::Unpick. r=arai https://hg.mozilla.org/integration/autoland/rev/89b1c584ae8e Part 2: Directly pass 'lhs' to emitSetOrInitializeDestructuring. r=arai https://hg.mozilla.org/integration/autoland/rev/a05af0c15ace Part 3: Reorder access in destructuring so most likely cases come first. r=arai https://hg.mozilla.org/integration/autoland/rev/4a19790129b7 Part 4: Remove unreachable code for BigInt property keys. r=arai https://hg.mozilla.org/integration/autoland/rev/28622fa10a79 Part 5: Reorder more property name operations to handle simple names first. r=arai https://hg.mozilla.org/integration/autoland/rev/5cbe09ca8c43 Part 6: Align Array and Object destructuring code paths. r=arai https://hg.mozilla.org/integration/autoland/rev/782ce39e8d24 Part 7: Simplify paren-free arrow function parsing. r=arai https://hg.mozilla.org/integration/autoland/rev/6a84be70015e Part 8: Remove a stale comment. r=arai https://hg.mozilla.org/integration/autoland/rev/412ef9eb0609 Part 9: Remove unused NumericLiteral setters. r=arai https://hg.mozilla.org/integration/autoland/rev/b267528cb51a Part 10: Inline literalIsZeroNoRadix into its single caller. r=arai
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
•