| Index: src/parser.h
|
| diff --git a/src/parser.h b/src/parser.h
|
| index b4c628ebb297fa90d86594c2656423dada3dc298..27207975608eda4a0ed19b3646ee2d7c94a83e3b 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);
|
| @@ -1024,12 +1025,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(
|
| @@ -1090,10 +1095,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);
|
| }
|
|
|
|
|
|
|