Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Issue 1423613002: Fix eval calls in initializers of arrow function parameters (Closed)

Created:
5 years, 2 months ago by adamk
Modified:
5 years, 1 month ago
Reviewers:
rossberg
CC:
v8-reviews_googlegroups.com, caitp (gmail)
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix eval calls in initializers of arrow function parameters This requires copying usage flags from the outer scope to the arrow scope upon encountering the arrow token. In order to properly pass-on the calls_eval bit, now record that bit on script scopes just like everywhere else, and add necessary code to scopes.cc to handle that change in behavior. Also factored out scope flag propagation to its own method to make the call site simple (though note that only the eval bit makes any difference for arrows). BUG=v8:4395 LOG=n Committed: https://crrev.com/0bdaa4d877f0823dbecb08fd9d409c1ebdbc1706 Cr-Commit-Position: refs/heads/master@{#31660}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebased #

Patch Set 3 : Propagate all flags #

Patch Set 4 : Try to fix TF #

Patch Set 5 : Propagate fewer flags #

Patch Set 6 : Change where we call PropagateFlags #

Patch Set 7 : Add one more test for global eval #

Patch Set 8 : Add contains_with_ #

Patch Set 9 : Fix build #

Total comments: 2

Patch Set 10 : Add comment, rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -13 lines) Patch
M src/preparser.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M src/scopes.h View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -1 line 0 comments Download
M src/scopes.cc View 1 2 3 4 5 6 7 8 9 2 chunks +21 lines, -10 lines 0 comments Download
M test/mjsunit/harmony/regress/regress-4395.js View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
A + test/mjsunit/harmony/regress/regress-4395-global-eval.js View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (4 generated)
adamk
5 years, 2 months ago (2015-10-22 12:07:27 UTC) #2
rossberg
https://codereview.chromium.org/1423613002/diff/1/src/parameter-initializer-rewriter.cc File src/parameter-initializer-rewriter.cc (right): https://codereview.chromium.org/1423613002/diff/1/src/parameter-initializer-rewriter.cc#newcode80 src/parameter-initializer-rewriter.cc:80: if (old_scope->calls_eval()) new_scope->RecordEvalCall(); I wonder about all the other ...
5 years, 2 months ago (2015-10-22 12:21:28 UTC) #3
adamk
On 2015/10/22 12:21:28, rossberg wrote: > https://codereview.chromium.org/1423613002/diff/1/src/parameter-initializer-rewriter.cc > File src/parameter-initializer-rewriter.cc (right): > > https://codereview.chromium.org/1423613002/diff/1/src/parameter-initializer-rewriter.cc#newcode80 > ...
5 years, 2 months ago (2015-10-22 12:31:07 UTC) #4
adamk
Hmm, the bots don't look too happy, will investigate whether this is the is_script_scope() bit.
5 years, 2 months ago (2015-10-22 12:32:44 UTC) #5
adamk
Yep, it's that bit (setting calls_eval on a script scope). No idea why TurboFan barfs ...
5 years, 2 months ago (2015-10-22 12:40:01 UTC) #6
rossberg
On 2015/10/22 12:31:07, adamk wrote: > On 2015/10/22 12:21:28, rossberg wrote: > > > https://codereview.chromium.org/1423613002/diff/1/src/parameter-initializer-rewriter.cc ...
5 years, 2 months ago (2015-10-22 13:00:44 UTC) #7
adamk
I've factored out the flag propagation logic from FinalizeBlockScope() into a new method, and called ...
5 years, 1 month ago (2015-10-26 21:14:21 UTC) #8
adamk
Okay, this is ready for re-review, finally. See updated CL description for what's changed (tl;dr: ...
5 years, 1 month ago (2015-10-27 22:44:19 UTC) #10
adamk
Re: various flags, I'm still not sure it makes sense to propagate anything other than ...
5 years, 1 month ago (2015-10-27 23:07:27 UTC) #11
adamk
On 2015/10/27 23:07:27, adamk wrote: > Re: various flags, I'm still not sure it makes ...
5 years, 1 month ago (2015-10-27 23:19:37 UTC) #12
adamk
To be clear: this is ready for review again.
5 years, 1 month ago (2015-10-28 18:04:41 UTC) #13
rossberg
lgtm https://codereview.chromium.org/1423613002/diff/150001/src/scopes.h File src/scopes.h (right): https://codereview.chromium.org/1423613002/diff/150001/src/scopes.h#newcode122 src/scopes.h:122: void PropagateUsageFlagsToScope(Scope* other); Nit: It would seem more ...
5 years, 1 month ago (2015-10-29 10:41:47 UTC) #14
adamk
https://codereview.chromium.org/1423613002/diff/150001/src/scopes.h File src/scopes.h (right): https://codereview.chromium.org/1423613002/diff/150001/src/scopes.h#newcode122 src/scopes.h:122: void PropagateUsageFlagsToScope(Scope* other); On 2015/10/29 10:41:47, rossberg wrote: > ...
5 years, 1 month ago (2015-10-29 14:44:59 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1423613002/170001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1423613002/170001
5 years, 1 month ago (2015-10-29 14:49:59 UTC) #18
commit-bot: I haz the power
Committed patchset #10 (id:170001)
5 years, 1 month ago (2015-10-29 15:16:11 UTC) #19
commit-bot: I haz the power
5 years, 1 month ago (2015-10-29 15:16:52 UTC) #20
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/0bdaa4d877f0823dbecb08fd9d409c1ebdbc1706
Cr-Commit-Position: refs/heads/master@{#31660}

Powered by Google App Engine
This is Rietveld 408576698