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

Unified Diff: src/parsing/parser.cc

Issue 2169823002: FunctionState doesn't need to know AstNodeFactory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 5 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
« no previous file with comments | « src/ast/ast.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 1dcd808e73b1cf1b51f6197c89e6f0d6ff6a8e8e..0e97efdf94793c904171b4db9495dd39b7b52b53 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -219,9 +219,8 @@ FunctionLiteral* Parser::DefaultConstructor(const AstRawString* name,
ZoneList<Statement*>* body = NULL;
{
- AstNodeFactory function_factory(ast_value_factory());
FunctionState function_state(&function_state_, &scope_state_,
- function_scope, kind, &function_factory);
+ function_scope, kind);
body = new (zone()) ZoneList<Statement*>(call_super ? 2 : 1, zone());
if (call_super) {
@@ -851,6 +850,7 @@ Parser::Parser(ParseInfo* info)
info->set_ast_value_factory(new AstValueFactory(zone(), info->hash_seed()));
info->set_ast_value_factory_owned();
ast_value_factory_ = info->ast_value_factory();
+ ast_node_factory_.set_ast_value_factory(ast_value_factory_);
}
}
@@ -966,9 +966,8 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
// Enter 'scope' with the given parsing mode.
ParsingModeScope parsing_mode_scope(this, parsing_mode);
- AstNodeFactory function_factory(ast_value_factory());
FunctionState function_state(&function_state_, &scope_state_, scope,
- kNormalFunction, &function_factory);
+ kNormalFunction);
ZoneList<Statement*>* body = new(zone()) ZoneList<Statement*>(16, zone());
bool ok = true;
@@ -1113,9 +1112,8 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info,
scope, ast_value_factory());
}
original_scope_ = scope;
- AstNodeFactory function_factory(ast_value_factory());
FunctionState function_state(&function_state_, &scope_state_, scope,
- shared_info->kind(), &function_factory);
+ shared_info->kind());
DCHECK(is_sloppy(scope->language_mode()) ||
is_strict(info->language_mode()));
DCHECK(info->language_mode() == shared_info->language_mode());
@@ -4307,9 +4305,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
// Parse function.
{
- AstNodeFactory function_factory(ast_value_factory());
- FunctionState function_state(&function_state_, &scope_state_, scope, kind,
- &function_factory);
+ FunctionState function_state(&function_state_, &scope_state_, scope, kind);
this->scope()->SetScopeName(function_name);
ExpressionClassifier formals_classifier(this, &duplicate_finder);
« no previous file with comments | « src/ast/ast.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698