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

Unified Diff: src/parsing/preparser.cc

Issue 2142333002: Refactor class declaration logic to the parser and runtime Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: minor cleanup per Adam Created 4 years, 5 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.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 08d5eafd4de581828aaa0d3090f2b0db9ddb1a64..9a978c11ae4e769ab5b106406aee7618aa3ca1b8 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -1258,6 +1258,12 @@ PreParserExpression PreParser::ParseClassLiteral(
Expect(Token::RBRACE, CHECK_OK);
+ // We desugar class literals into a runtime function call which takes three
+ // new array literals as arguments, so we need to reserve indices for them.
+ function_state_->NextMaterializedLiteralIndex();
+ function_state_->NextMaterializedLiteralIndex();
+ function_state_->NextMaterializedLiteralIndex();
+
return Expression::Default();
}
« src/parsing/parser.cc ('K') | « src/parsing/preparser.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698