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

Unified Diff: src/parsing/preparser.h

Issue 2297733002: [parser] Refactor bookmark in SkipLazyFunctionBody (Closed)
Patch Set: Created 4 years, 4 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
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index 8fb4b0c4787e6d9401c27f18ed11b4627dcc78df..0b8bea228e64b150085bfbeb1516a80c73b28e42 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -292,6 +292,7 @@ class PreParserExpression {
// More dummy implementations of things PreParser doesn't need to track:
void set_index(int index) {} // For YieldExpressions
void set_should_eager_compile() {}
+ void set_should_be_used_once_hint() {}
int position() const { return kNoSourcePosition; }
void set_function_token_position(int position) {}
@@ -637,6 +638,7 @@ class PreParser : public ParserBase<PreParser> {
enum PreParseResult {
kPreParseStackOverflow,
+ kPreParseAbort,
kPreParseSuccess
};
@@ -693,8 +695,7 @@ class PreParser : public ParserBase<PreParser> {
FunctionKind kind,
bool has_simple_parameters,
bool parsing_module, ParserRecorder* log,
- Scanner::BookmarkScope* bookmark,
- int* use_counts);
+ bool may_abort, int* use_counts);
// A dummy function, just useful as an argument to CHECK_OK_CUSTOM.
static void Void() {}
@@ -712,8 +713,10 @@ class PreParser : public ParserBase<PreParser> {
// By making the 'exception handling' explicit, we are forced to check
// for failure at the call sites.
Statement ParseStatementListItem(bool* ok);
- void ParseStatementList(int end_token, bool* ok,
- Scanner::BookmarkScope* bookmark = nullptr);
+ V8_INLINE bool ParseStatementList(int end_token, bool* ok) {
+ return ParseStatementList(end_token, false, ok);
vogelheim 2016/08/30 16:28:42 If may_abort is set to false, ParseStatementList w
nickie 2016/08/31 13:23:36 Done.
+ }
+ bool ParseStatementList(int end_token, bool may_abort, bool* ok);
Statement ParseStatement(AllowLabelledFunctionStatement allow_function,
bool* ok);
Statement ParseSubStatement(AllowLabelledFunctionStatement allow_function,
@@ -759,9 +762,9 @@ class PreParser : public ParserBase<PreParser> {
const PreParserFormalParameters& parameters, FunctionKind kind,
FunctionLiteral::FunctionType function_type, bool* ok);
- V8_INLINE void SkipLazyFunctionBody(
- int* materialized_literal_count, int* expected_property_count, bool* ok,
- Scanner::BookmarkScope* bookmark = nullptr) {
+ V8_INLINE bool SkipLazyFunctionBody(int* materialized_literal_count,
+ int* expected_property_count,
+ bool may_abort, bool* ok) {
UNREACHABLE();
}
Expression ParseFunctionLiteral(
@@ -769,8 +772,7 @@ class PreParser : public ParserBase<PreParser> {
FunctionNameValidity function_name_validity, FunctionKind kind,
int function_token_pos, FunctionLiteral::FunctionType function_type,
LanguageMode language_mode, bool* ok);
- void ParseLazyFunctionLiteralBody(bool* ok,
- Scanner::BookmarkScope* bookmark = nullptr);
+ bool ParseLazyFunctionLiteralBody(bool may_abort, bool* ok);
PreParserExpression ParseClassLiteral(PreParserIdentifier name,
Scanner::Location class_name_location,
@@ -1000,6 +1002,9 @@ class PreParser : public ParserBase<PreParser> {
V8_INLINE static PreParserExpressionList NullExpressionList() {
return PreParserExpressionList();
}
+ V8_INLINE static PreParserStatementList NullStatementList() {
+ return PreParserStatementList();
+ }
V8_INLINE PreParserIdentifier EmptyIdentifierString() const {
return PreParserIdentifier::Default();
}

Powered by Google App Engine
This is Rietveld 408576698