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

Unified Diff: src/parser.cc

Issue 334173003: Reuse AstValueFactory when optimizing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/hydrogen.cc ('k') | no next file » | 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 722ed8beaf470288df7de99157ea58a191ec7c23..b8855fd8f0ac1c0d267a0c2c583ebd52bec9b892 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4793,9 +4793,11 @@ bool RegExpParser::ParseRegExp(FlatStringReader* input,
bool Parser::Parse() {
ASSERT(info()->function() == NULL);
- ASSERT(info()->ast_value_factory() == NULL);
FunctionLiteral* result = NULL;
- ast_value_factory_ = new AstValueFactory(zone());
+ ast_value_factory_ = info()->ast_value_factory();
+ if (ast_value_factory_ == NULL) {
+ ast_value_factory_ = new AstValueFactory(zone());
+ }
if (allow_natives_syntax() || extension_ != NULL) {
// If intrinsics are allowed, the Parser cannot operate independent of the
// V8 heap because of Rumtime. Tell the string table to internalize strings
@@ -4830,7 +4832,9 @@ bool Parser::Parse() {
info()->SetFunction(result);
ast_value_factory_->Internalize(isolate());
// info takes ownership of ast_value_factory_.
- info()->SetAstValueFactory(ast_value_factory_);
+ if (info()->ast_value_factory() == NULL) {
+ info()->SetAstValueFactory(ast_value_factory_);
+ }
ast_value_factory_ = NULL;
return (result != NULL);
}
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698