Make new.target a real binding
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox101 | --- | fixed |
People
(Reporter: shu, Assigned: anba)
References
Details
(Keywords: triage-deferred)
Attachments
(13 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 | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
After the bindings rewrite lands, we can make new.target a real binding and remove the need for arrows to be extended functions and make them syntax parseable.
Comment 1•7 years ago
|
||
Can or should we fix this now?
Updated•7 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
And reduce duplicated code when checking for the number of required arguments.
When creating the next patch of this series, I've noticed that we check for self-hosted
helper functions even when the call operation isn't JSOp::Call
. This could lead to
silently doing the wrong thing when operation is for example JSOp::New
. Interestingly
we already skipped this code path for spread calls. Anyway, to make this code more
robust, self-hosted helper functions are now only checked when op == JSOp::Call
.
Updated•2 years ago
|
Assignee | ||
Comment 3•2 years ago
|
||
Needed for part 4.
This just moves the code to push new.target
.
Depends on D142794
Assignee | ||
Comment 4•2 years ago
|
||
NewTargetNode
is a ternary node to additionally hold the "new.target"
binding. Also see patch 5.
Depends on D142795
Assignee | ||
Comment 5•2 years ago
|
||
Only super()
and new.target
should be able to emit JSOp::NewTarget
.
Depends on D142796
Assignee | ||
Comment 6•2 years ago
|
||
new.target
is now a normal binding, similar to how the this
binding works.
Depends on D142797
Assignee | ||
Comment 7•2 years ago
|
||
This just moves the code to declare the internal names.
Depends on D142798
Assignee | ||
Comment 8•2 years ago
|
||
The new.target
slot for arrow functions is no longer read, so we can
simply initialise it to undefined
.
The next patches will remove the slot and make further clean-ups.
Depends on D142800
Assignee | ||
Comment 9•2 years ago
|
||
The previous patch changed the "new.target" slot, so it always is set to null
.
This patch changes all readers to directly return null
resp. assert that the
code path isn't taken for arrow functions.
Depends on D142801
Assignee | ||
Comment 10•2 years ago
|
||
After the last patch, JSOp::Lambda
and JSOp::LambdaArrow
are both doing the
exact same thing, so we can just remove the latter.
Depends on D142802
Assignee | ||
Comment 11•2 years ago
|
||
Additionally assert that JSOp::NewTarget
is only emitted for non-arrow function
scripts.
Depends on D142803
Assignee | ||
Comment 12•2 years ago
|
||
We no longer have to split emit_NewTarget
, now that the only differences
between blinterp and baseline are just debug-only assertions.
Depends on D142804
Assignee | ||
Comment 13•2 years ago
|
||
EvalNewTarget is now also no longer needed.
Depends on D142805
Assignee | ||
Comment 14•2 years ago
|
||
Depends on D142806
Comment 15•2 years ago
|
||
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/a5258269f92a Part 1: Ensure self-hosting helpers are only called as functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/9754fee0f38f Part 2: Move single spread end-if and new.target handling out of CallOrNewEmitter::emitEnd(). r=jandem https://hg.mozilla.org/integration/autoland/rev/da0564198265 Part 3: Add a separate parse node for "new.target". r=jandem https://hg.mozilla.org/integration/autoland/rev/6c0d0d2c11e9 Part 4: Ensure emitNewTarget() can only be called from valid parse nodes. r=jandem https://hg.mozilla.org/integration/autoland/rev/7edf3a4d9a70 Part 5: Declare new.target function binding. r=jandem https://hg.mozilla.org/integration/autoland/rev/d676fb30e278 Part 6: Consistenly declare internal names before finishing the function lexical scope. r=jandem https://hg.mozilla.org/integration/autoland/rev/639ebc18e9d1 Part 7: Stop storing new.target in arrow functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/a3066ae421e6 Part 8: Stop allocating arrow functions as extended functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/f9076fbfcec2 Part 9: Delete JSOp::LambdaArrow. r=jandem https://hg.mozilla.org/integration/autoland/rev/b96299f00356 Part 10: Check JSOp::NewTarget is only used in non-arrow function scripts. r=jandem https://hg.mozilla.org/integration/autoland/rev/3599669c384c Part 11: Share emit_NewTarget() for baseline compilation. r=jandem https://hg.mozilla.org/integration/autoland/rev/21175a7a8601 Part 12: Remove EvalNewTarget. r=jandem https://hg.mozilla.org/integration/autoland/rev/0b35af3e37ea Part 13: Remove new.target access from frame classes. r=jandem
Comment 16•2 years ago
|
||
Backed out 13 changesets (Bug 1282976) for causing build bustages on BytecodeEmitter.cpp.
Backout link
Push with failures
Failure Log
Assignee | ||
Updated•2 years ago
|
Comment 17•2 years ago
|
||
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/e5a646722d80 Part 1: Ensure self-hosting helpers are only called as functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/9e2976475f16 Part 2: Move single spread end-if and new.target handling out of CallOrNewEmitter::emitEnd(). r=jandem https://hg.mozilla.org/integration/autoland/rev/468869caeead Part 3: Add a separate parse node for "new.target". r=jandem https://hg.mozilla.org/integration/autoland/rev/44d8fb5ba8d2 Part 4: Ensure emitNewTarget() can only be called from valid parse nodes. r=jandem https://hg.mozilla.org/integration/autoland/rev/97011d13d382 Part 5: Declare new.target function binding. r=jandem https://hg.mozilla.org/integration/autoland/rev/66b9be812531 Part 6: Consistenly declare internal names before finishing the function lexical scope. r=jandem https://hg.mozilla.org/integration/autoland/rev/f040e1aaef57 Part 7: Stop storing new.target in arrow functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/96181ab3db66 Part 8: Stop allocating arrow functions as extended functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/b0b2e0a0563d Part 9: Delete JSOp::LambdaArrow. r=jandem https://hg.mozilla.org/integration/autoland/rev/f384f837450d Part 10: Check JSOp::NewTarget is only used in non-arrow function scripts. r=jandem https://hg.mozilla.org/integration/autoland/rev/256840e3ca1a Part 11: Share emit_NewTarget() for baseline compilation. r=jandem https://hg.mozilla.org/integration/autoland/rev/a0c51a971bb6 Part 12: Remove EvalNewTarget. r=jandem https://hg.mozilla.org/integration/autoland/rev/14b23dd0871b Part 13: Remove new.target access from frame classes. r=jandem
Comment 18•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e5a646722d80
https://hg.mozilla.org/mozilla-central/rev/9e2976475f16
https://hg.mozilla.org/mozilla-central/rev/468869caeead
https://hg.mozilla.org/mozilla-central/rev/44d8fb5ba8d2
https://hg.mozilla.org/mozilla-central/rev/97011d13d382
https://hg.mozilla.org/mozilla-central/rev/66b9be812531
https://hg.mozilla.org/mozilla-central/rev/f040e1aaef57
https://hg.mozilla.org/mozilla-central/rev/96181ab3db66
https://hg.mozilla.org/mozilla-central/rev/b0b2e0a0563d
https://hg.mozilla.org/mozilla-central/rev/f384f837450d
https://hg.mozilla.org/mozilla-central/rev/256840e3ca1a
https://hg.mozilla.org/mozilla-central/rev/a0c51a971bb6
https://hg.mozilla.org/mozilla-central/rev/14b23dd0871b
Description
•