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

Unified Diff: src/parser.cc

Issue 633373003: Simplify AST ID generation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: DISALLOW_COPY_AND_ASSIGN Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/ast.h ('K') | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 04efd1ec747089ac0106596972f043a6e212bbe8..f36cc3fd93f3a745c11696d0bf5a9ad6c19e57bb 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -877,8 +877,10 @@ FunctionLiteral* Parser::DoParseProgram(CompilationInfo* info, Scope** scope,
ParsingModeScope parsing_mode(this, mode);
// Enters 'scope'.
- FunctionState function_state(&function_state_, &scope_, *scope, zone(),
- ast_value_factory(), info->ast_node_id_gen());
+ AstNodeFactory<AstConstructionVisitor> function_factory(
+ zone(), ast_value_factory(), info->ast_node_id_gen());
+ FunctionState function_state(&function_state_, &scope_, *scope,
+ &function_factory);
scope_->SetStrictMode(info->strict_mode());
ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone());
@@ -990,9 +992,10 @@ FunctionLiteral* Parser::ParseLazy(Utf16CharacterStream* source) {
zone());
}
original_scope_ = scope;
- FunctionState function_state(&function_state_, &scope_, scope, zone(),
- ast_value_factory(),
- info()->ast_node_id_gen());
+ AstNodeFactory<AstConstructionVisitor> function_factory(
+ zone(), ast_value_factory(), info()->ast_node_id_gen());
+ FunctionState function_state(&function_state_, &scope_, scope,
+ &function_factory);
DCHECK(scope->strict_mode() == SLOPPY || info()->strict_mode() == STRICT);
DCHECK(info()->strict_mode() == shared_info->strict_mode());
scope->SetStrictMode(shared_info->strict_mode());
@@ -3491,9 +3494,10 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
BailoutReason dont_optimize_reason = kNoReason;
// Parse function body.
{
- FunctionState function_state(&function_state_, &scope_, scope, zone(),
- ast_value_factory(),
- info()->ast_node_id_gen());
+ AstNodeFactory<AstConstructionVisitor> function_factory(
+ zone(), ast_value_factory(), info()->ast_node_id_gen());
+ FunctionState function_state(&function_state_, &scope_, scope,
+ &function_factory);
scope_->SetScopeName(function_name);
if (is_generator) {
« src/ast.h ('K') | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698