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

Issue 1950803002: Don't treat catch scopes as possibly-shadowing for sloppy eval (Closed)

Created:
4 years, 7 months ago by adamk
Modified:
4 years, 7 months ago
Reviewers:
Dan Ehrenberg, rmcilroy
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

Don't treat catch scopes as possibly-shadowing for sloppy eval Scope analysis is over-conservative when treating variable resolutions as possibly-shadowed by a sloppy eval. In the attached bug, this comes into play since catch scopes have different behavior with respect to the "calls eval" in eager vs lazy compilation (in the latter, they are never marked as "calls eval" because CatchContexts don't have an associated ScopeInfo). This patch changes the scope-type check to also eliminate a few other cases where shadowing isn't possible, such as non-declaration block scopes. BUG=chromium:608279 LOG=n Committed: https://crrev.com/75f2d65f003ebb22815489e9970913ba37234f1b Cr-Commit-Position: refs/heads/master@{#36046}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Use is_declaration_scope instead of !is_catch_scope #

Total comments: 2

Patch Set 3 : Amend comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -2 lines) Patch
M src/ast/scopes.cc View 1 2 1 chunk +5 lines, -2 lines 0 comments Download
A test/mjsunit/regress/regress-crbug-608279.js View 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (6 generated)
adamk
4 years, 7 months ago (2016-05-04 00:30:04 UTC) #2
rmcilroy
On 2016/05/04 00:30:04, adamk wrote: Thanks Adam, LGTM.
4 years, 7 months ago (2016-05-04 08:50:43 UTC) #3
adamk
I've updated the patch to widen the change: we now ignore shadowing not just for ...
4 years, 7 months ago (2016-05-04 20:43:50 UTC) #5
Dan Ehrenberg
lgtm https://codereview.chromium.org/1950803002/diff/1/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/1950803002/diff/1/src/ast/scopes.cc#newcode1101 src/ast/scopes.cc:1101: } else if (calls_sloppy_eval() && !is_script_scope() && !is_catch_scope() ...
4 years, 7 months ago (2016-05-04 20:54:08 UTC) #6
adamk
Added to the comment. https://codereview.chromium.org/1950803002/diff/1/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/1950803002/diff/1/src/ast/scopes.cc#newcode1101 src/ast/scopes.cc:1101: } else if (calls_sloppy_eval() && ...
4 years, 7 months ago (2016-05-04 21:06:19 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1950803002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1950803002/40001
4 years, 7 months ago (2016-05-04 21:06:28 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 7 months ago (2016-05-04 21:34:51 UTC) #12
commit-bot: I haz the power
4 years, 7 months ago (2016-05-04 21:36:20 UTC) #14
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/75f2d65f003ebb22815489e9970913ba37234f1b
Cr-Commit-Position: refs/heads/master@{#36046}

Powered by Google App Engine
This is Rietveld 408576698