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

Unified Diff: src/parser.cc

Issue 909463003: PreParser / Parser consistency: Make PreParser aware of Zone and AstValueFactory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . Created 5 years, 10 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/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 0dbfe5d18522d4799207318a42f22f879fd08f35..f21d443fcd2a980adbc67e8bcea8b3f50e8ab098 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -671,7 +671,7 @@ const AstRawString* ParserTraits::GetNumberAsSymbol(Scanner* scanner) {
char array[100];
const char* string =
DoubleToCString(double_value, Vector<char>(array, arraysize(array)));
- return ast_value_factory()->GetOneByteString(string);
+ return parser_->ast_value_factory()->GetOneByteString(string);
}
@@ -794,8 +794,8 @@ ClassLiteral* ParserTraits::ParseClassLiteral(
Parser::Parser(CompilationInfo* info, ParseInfo* parse_info)
: ParserBase<ParserTraits>(info->isolate(), info->zone(), &scanner_,
- parse_info->stack_limit, info->extension(), NULL,
- this),
+ parse_info->stack_limit, info->extension(),
+ info->ast_value_factory(), NULL, this),
scanner_(parse_info->unicode_cache),
reusable_preparser_(NULL),
original_scope_(NULL),
@@ -832,6 +832,7 @@ Parser::Parser(CompilationInfo* info, ParseInfo* parse_info)
// info takes ownership of AstValueFactory.
info->SetAstValueFactory(
new AstValueFactory(zone(), parse_info->hash_seed));
+ ast_value_factory_ = info->ast_value_factory();
}
}
@@ -3987,8 +3988,8 @@ PreParser::PreParseResult Parser::ParseLazyFunctionBodyWithPreParser(
DCHECK_EQ(Token::LBRACE, scanner()->current_token());
if (reusable_preparser_ == NULL) {
- reusable_preparser_ =
- new PreParser(isolate(), &scanner_, NULL, stack_limit_);
+ reusable_preparser_ = new PreParser(
+ isolate(), zone(), &scanner_, ast_value_factory(), NULL, stack_limit_);
reusable_preparser_->set_allow_lazy(true);
reusable_preparser_->set_allow_natives(allow_natives());
reusable_preparser_->set_allow_harmony_scoping(allow_harmony_scoping());
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698