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

Unified Diff: src/parsing/parser.h

Issue 2738153003: [parser] Make reusable_preparser really reusable (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 77a0f64b343910044b8f16a2d3a7303a3ba5f656..3ee3cdb53bbdc697c30f99097f6430d12cdae276 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -299,6 +299,26 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
return compile_options_ == ScriptCompiler::kProduceParserCache;
}
+ PreParser* reusable_preparser() {
+ if (reusable_preparser_ == NULL) {
+ reusable_preparser_ =
+ new PreParser(zone(), &scanner_, stack_limit_, ast_value_factory(),
+ &pending_error_handler_, runtime_call_stats_,
+ parsing_on_main_thread_);
+#define SET_ALLOW(name) reusable_preparser_->set_allow_##name(allow_##name());
+ SET_ALLOW(natives);
+ SET_ALLOW(harmony_do_expressions);
+ SET_ALLOW(harmony_function_sent);
+ SET_ALLOW(harmony_trailing_commas);
+ SET_ALLOW(harmony_class_fields);
+ SET_ALLOW(harmony_object_rest_spread);
+ SET_ALLOW(harmony_dynamic_import);
+ SET_ALLOW(harmony_async_iteration);
+#undef SET_ALLOW
+ }
+ return reusable_preparser_;
+ }
+
void ParseModuleItemList(ZoneList<Statement*>* body, bool* ok);
Statement* ParseModuleItem(bool* ok);
const AstRawString* ParseModuleSpecifier(bool* ok);
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698