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

Issue 2662183002: [parser] Remove hoist_scope from DeclarationDescriptor (Closed)

Created:
3 years, 10 months ago by adamk
Modified:
3 years, 10 months ago
Reviewers:
neis
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[parser] Remove hoist_scope from DeclarationDescriptor The hoist_scope member of DeclarationDescriptor was only used to pass the function scope for declaration of parameters containing sloppy evals, for example: function f(x = eval("var y")) { } In cases like this, "x" is declared in the function scope but "y" is declared in an inner scope. Rather than passing the function scope as "hoist_scope", we simply ask for the outer_scope() of the inner scope as needed in PatternRewriter. This reduces the cognitive overhead of understanding what a DeclarationDescriptor has; for example, it removes some dead code from the PreParser which never has to deal with a situation like the example above. Review-Url: https://codereview.chromium.org/2662183002 Cr-Commit-Position: refs/heads/master@{#42861} Committed: https://chromium.googlesource.com/v8/v8/+/59b8496c81eda6da774af2991a8cf641797a754e

Patch Set 1 #

Patch Set 2 : Factored out helper function #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -27 lines) Patch
M src/parsing/parser.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/parsing/parser.cc View 3 chunks +0 lines, -3 lines 0 comments Download
M src/parsing/parser-base.h View 2 chunks +0 lines, -2 lines 0 comments Download
M src/parsing/pattern-rewriter.cc View 1 2 chunks +36 lines, -16 lines 5 comments Download
M src/parsing/preparser.cc View 1 chunk +2 lines, -6 lines 0 comments Download

Messages

Total messages: 15 (9 generated)
adamk
3 years, 10 months ago (2017-01-31 20:20:19 UTC) #5
neis
lgtm, very nice https://codereview.chromium.org/2662183002/diff/20001/src/parsing/pattern-rewriter.cc File src/parsing/pattern-rewriter.cc (right): https://codereview.chromium.org/2662183002/diff/20001/src/parsing/pattern-rewriter.cc#newcode147 src/parsing/pattern-rewriter.cc:147: outer_function_scope = descriptor_->scope->outer_scope(); Can you add ...
3 years, 10 months ago (2017-02-01 08:55:24 UTC) #8
adamk
https://codereview.chromium.org/2662183002/diff/20001/src/parsing/pattern-rewriter.cc File src/parsing/pattern-rewriter.cc (right): https://codereview.chromium.org/2662183002/diff/20001/src/parsing/pattern-rewriter.cc#newcode147 src/parsing/pattern-rewriter.cc:147: outer_function_scope = descriptor_->scope->outer_scope(); On 2017/02/01 08:55:24, neis wrote: > ...
3 years, 10 months ago (2017-02-01 16:22:15 UTC) #9
neis
https://codereview.chromium.org/2662183002/diff/20001/src/parsing/pattern-rewriter.cc File src/parsing/pattern-rewriter.cc (right): https://codereview.chromium.org/2662183002/diff/20001/src/parsing/pattern-rewriter.cc#newcode343 src/parsing/pattern-rewriter.cc:343: DCHECK(scope()->outer_scope()->is_function_scope()); On 2017/02/01 16:22:15, adamk wrote: > On 2017/02/01 ...
3 years, 10 months ago (2017-02-01 16:26:42 UTC) #10
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/2662183002/20001
3 years, 10 months ago (2017-02-01 16:53:24 UTC) #12
commit-bot: I haz the power
3 years, 10 months ago (2017-02-01 16:55:27 UTC) #15
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/v8/v8/+/59b8496c81eda6da774af2991a8cf641797...

Powered by Google App Engine
This is Rietveld 408576698