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

Unified Diff: src/parser.h

Issue 1102523003: Implement a 'trial parse' step, that will abort pre-parsing excessively (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use a seperate 'hint' bit for "to be executed once" code aging. Created 5 years, 7 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/compiler.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index 58253e1bb6919309a444864f10bfff904efb837f..1a84ec4157aff1210e7a8aeb2458d6d4cd91a2e8 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -773,8 +773,9 @@ class ParserTraits {
bool name_is_strict_reserved, FunctionKind kind,
int function_token_position, FunctionLiteral::FunctionType type,
FunctionLiteral::ArityRestriction arity_restriction, bool* ok);
- V8_INLINE void SkipLazyFunctionBody(int* materialized_literal_count,
- int* expected_property_count, bool* ok);
+ V8_INLINE void SkipLazyFunctionBody(
+ int* materialized_literal_count, int* expected_property_count, bool* ok,
+ Scanner::BookmarkScope* bookmark = nullptr);
V8_INLINE ZoneList<Statement*>* ParseEagerFunctionBody(
const AstRawString* name, int pos, Variable* fvar,
Token::Value fvar_init_op, FunctionKind kind, bool* ok);
@@ -1023,12 +1024,16 @@ class Parser : public ParserBase<ParserTraits> {
// Skip over a lazy function, either using cached data if we have it, or
// by parsing the function with PreParser. Consumes the ending }.
+ //
+ // If bookmark is set, the (pre-)parser may decide to abort skipping
+ // in order to force the function to be eagerly parsed, after all.
+ // In this case, it'll reset the scanner using the bookmark.
void SkipLazyFunctionBody(int* materialized_literal_count,
- int* expected_property_count,
- bool* ok);
+ int* expected_property_count, bool* ok,
+ Scanner::BookmarkScope* bookmark = nullptr);
PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser(
- SingletonLogger* logger);
+ SingletonLogger* logger, Scanner::BookmarkScope* bookmark = nullptr);
// Consumes the ending }.
ZoneList<Statement*>* ParseEagerFunctionBody(
@@ -1089,10 +1094,10 @@ const AstRawString* ParserTraits::EmptyIdentifierString() {
void ParserTraits::SkipLazyFunctionBody(int* materialized_literal_count,
- int* expected_property_count,
- bool* ok) {
- return parser_->SkipLazyFunctionBody(
- materialized_literal_count, expected_property_count, ok);
+ int* expected_property_count, bool* ok,
+ Scanner::BookmarkScope* bookmark) {
+ return parser_->SkipLazyFunctionBody(materialized_literal_count,
+ expected_property_count, ok, bookmark);
}
« no previous file with comments | « src/compiler.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698