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

Issue 148293011: Refactor scope and function state tracking in (Pre)Parser. (Closed)

Created:
6 years, 10 months ago by marja
Modified:
6 years, 10 months ago
Reviewers:
ulan
CC:
v8-dev
Visibility:
Public.

Description

Refactor scope and function state tracking in (Pre)Parser. Notes: - PreParser::Scope was a weird combination of Parser::FunctionState and Scope. Split it into two (PreParser::FunctionState and PreParser::Scope). This is necessary for unifying the Parser and the PreParser. - Scopes take care of language mode and tracking "with". - FunctionStates take care of counting material literal indexes, properties etc. and tracking generators. - PreParser::Scope::InsideWith was a hack to make a FunctionState-like object take care of tracking "with". It's now the responsibility fo PreParser::Scope and Scope. - PreParser::ScopeType is unnecessarly, there is already a ScopeType enum in v8globals.h. - Renamed scope stack variables so that they're consistent in Parser and PreParser. - Parser::FunctionState and Parser::BlockState had an unnecessary dependency to the Parser; they only need a couple of things from Parser. Broke the dependency. R=ulan@chromium.org BUG=v8:3126 LOG=N Committed: https://code.google.com/p/v8/source/detail?r=19319

Patch Set 1 #

Patch Set 2 : refactor more #

Patch Set 3 : removing unnecessary friends #

Total comments: 2

Patch Set 4 : rebased #

Patch Set 5 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -211 lines) Patch
M src/parser.h View 1 2 3 4 6 chunks +13 lines, -11 lines 0 comments Download
M src/parser.cc View 1 2 3 4 70 chunks +128 lines, -124 lines 0 comments Download
M src/preparser.h View 1 2 3 4 5 chunks +76 lines, -53 lines 0 comments Download
M src/preparser.cc View 1 16 chunks +24 lines, -23 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ulan
lgtm https://codereview.chromium.org/148293011/diff/60001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/148293011/diff/60001/src/parser.cc#newcode498 src/parser.cc:498: outer_scope_(*scope_stack), We have two many scope stacks =) ...
6 years, 10 months ago (2014-02-12 10:16:50 UTC) #1
marja
Thanks for review! The simplification doesn't unfortunately work :( https://codereview.chromium.org/148293011/diff/60001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/148293011/diff/60001/src/parser.cc#newcode498 src/parser.cc:498: ...
6 years, 10 months ago (2014-02-12 11:36:56 UTC) #2
marja
6 years, 10 months ago (2014-02-12 12:02:14 UTC) #3
Message was sent while issue was closed.
Committed patchset #5 manually as r19319 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698