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

Unified Diff: src/parser.cc

Issue 913183005: Inline the ParseInfo structure as parameters to the Parser constructor. (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') | test/cctest/test-parsing.cc » ('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 6db0053a69824a0d23796fda793222a540680d70..c1e6815b002af688d7be6266384c1e561f3df94f 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -788,11 +788,12 @@ ClassLiteral* ParserTraits::ParseClassLiteral(
}
-Parser::Parser(CompilationInfo* info, ParseInfo* parse_info)
+Parser::Parser(CompilationInfo* info, uintptr_t stack_limit, uint32_t hash_seed,
+ UnicodeCache* unicode_cache)
: ParserBase<ParserTraits>(info->isolate(), info->zone(), &scanner_,
- parse_info->stack_limit, info->extension(),
+ stack_limit, info->extension(),
info->ast_value_factory(), NULL, this),
- scanner_(parse_info->unicode_cache),
+ scanner_(unicode_cache),
reusable_preparser_(NULL),
original_scope_(NULL),
target_stack_(NULL),
@@ -827,8 +828,7 @@ Parser::Parser(CompilationInfo* info, ParseInfo* parse_info)
}
if (info->ast_value_factory() == NULL) {
// info takes ownership of AstValueFactory.
- info->SetAstValueFactory(
- new AstValueFactory(zone(), parse_info->hash_seed));
+ info->SetAstValueFactory(new AstValueFactory(zone(), hash_seed));
ast_value_factory_ = info->ast_value_factory();
}
}
@@ -5251,6 +5251,19 @@ bool RegExpParser::ParseRegExp(Isolate* isolate, Zone* zone,
}
+bool Parser::Parse(CompilationInfo* info, bool allow_lazy) {
+ Parser parser(info, info->isolate()->stack_guard()->real_climit(),
+ info->isolate()->heap()->HashSeed(),
+ info->isolate()->unicode_cache());
+ parser.set_allow_lazy(allow_lazy);
+ if (parser.Parse()) {
+ info->SetLanguageMode(info->function()->language_mode());
+ return true;
+ }
+ return false;
+}
+
+
bool Parser::Parse() {
DCHECK(info()->function() == NULL);
FunctionLiteral* result = NULL;
« no previous file with comments | « src/parser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698