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

Issue 2230323004: Cleanup scope resolution (Closed)

Created:
4 years, 4 months ago by Toon Verwaest
Modified:
4 years, 4 months ago
Reviewers:
adamk, marja
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Cleanup scope resolution BUG=v8:5209 Committed: https://crrev.com/e77a78cd2d17d4b3b0bf2db79c5d83bf4b2150c2 Cr-Commit-Position: refs/heads/master@{#38580}

Patch Set 1 #

Patch Set 2 : Add dcheck #

Patch Set 3 : Add eval scope #

Total comments: 3

Patch Set 4 : Addressed comment (fix + test) #

Patch Set 5 : More comments #

Patch Set 6 : rebase #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -53 lines) Patch
M src/ast/scopes.h View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M src/ast/scopes.cc View 1 2 3 4 5 4 chunks +56 lines, -50 lines 6 comments Download
A + test/mjsunit/function-name-eval-shadowed.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 21 (7 generated)
Toon Verwaest
ptal
4 years, 4 months ago (2016-08-11 09:00:50 UTC) #2
marja
https://codereview.chromium.org/2230323004/diff/40001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2230323004/diff/40001/src/ast/scopes.cc#newcode1301 src/ast/scopes.cc:1301: return var; As discussed offline, this changes the behavior ...
4 years, 4 months ago (2016-08-11 09:37:35 UTC) #3
Toon Verwaest
Addressed comments, added test.
4 years, 4 months ago (2016-08-11 10:50:46 UTC) #4
Toon Verwaest
Addressed comment. I'm not 100% sure it's better, since we can't reresolve that VariableProxy to ...
4 years, 4 months ago (2016-08-11 11:33:01 UTC) #5
Toon Verwaest
Oops, totally the wrong CL for that comment, ignore me!
4 years, 4 months ago (2016-08-11 11:33:23 UTC) #6
marja
lgtm
4 years, 4 months ago (2016-08-11 11:44:39 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2230323004/80001
4 years, 4 months ago (2016-08-11 12:55:15 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_avx2_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/builds/6726) v8_linux64_gyp_rel_ng on master.tryserver.v8 (JOB_FAILED, ...
4 years, 4 months ago (2016-08-11 12:56:29 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2230323004/100001
4 years, 4 months ago (2016-08-11 12:58:45 UTC) #14
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 4 months ago (2016-08-11 13:25:49 UTC) #15
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/e77a78cd2d17d4b3b0bf2db79c5d83bf4b2150c2 Cr-Commit-Position: refs/heads/master@{#38580}
4 years, 4 months ago (2016-08-11 13:26:13 UTC) #17
adamk
I'm not clear on what this CL cleans up (I actually find it harder to ...
4 years, 4 months ago (2016-08-11 18:19:19 UTC) #19
Toon Verwaest
I find it cleaner at least. It moves branches to where they are relevant, and ...
4 years, 4 months ago (2016-08-12 05:16:58 UTC) #20
adamk
4 years, 4 months ago (2016-08-15 17:45:00 UTC) #21
Message was sent while issue was closed.
https://codereview.chromium.org/2230323004/diff/100001/src/ast/scopes.cc
File src/ast/scopes.cc (right):

https://codereview.chromium.org/2230323004/diff/100001/src/ast/scopes.cc#newc...
src/ast/scopes.cc:1325: DCHECK(!is_with_scope());
On 2016/08/12 05:16:58, Toon Verwaest wrote:
> On 2016/08/11 18:19:19, adamk wrote:
> > If you want this DCHECK to be useful it's gotta go the one above :)
> 
> I don't see the issue with checking both? I can remove either if you insist.

What I mean is that a with scope will fail on the previous line without
revealing its with-scope-ness. I think there's value in both DCHECKs, but only
in reverse order.

https://codereview.chromium.org/2230323004/diff/100001/src/ast/scopes.cc#newc...
src/ast/scopes.cc:1328: if (calls_sloppy_eval() && is_declaration_scope() &&
!is_script_scope()) {
On 2016/08/12 05:16:58, Toon Verwaest wrote:
> On 2016/08/11 18:19:19, adamk wrote:
> > This is no longer guarded by "name_can_be_shadowed"...was that intentional?
> 
> It is. Either we have a var null since outer scope, in which case name can be
> shadowed, or we returned early above.
> 
> See, the old code wasn't easy to understand ;-)

Point taken :)

Powered by Google App Engine
This is Rietveld 408576698