Reviewers: ulan,

Message:
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: outer_scope_(*scope_stack),
On 2014/02/12 10:16:51, ulan wrote:
We have two many scope stacks =)
Does this precondition hold: *scope_stack == scope->outer_scope_?
If yes could you assert this or get rid of outer_scope_ here.

It doesn't hold. In Parser::ParseLazy we seem to push a scope to the
scope stack which has outer_scope == NULL, even though there are some
scopes in the stack already. Scope::DeserializeScopeChain seems to
complicate things.

-> outer_scope_ was here for a reason, leaving it like this.

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.


[email protected]
BUG=v8:3126
LOG=N

Please review this at https://codereview.chromium.org/148293011/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+241, -211 lines):
  M src/parser.h
  M src/parser.cc
  M src/preparser.h
  M src/preparser.cc


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to