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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2849773002: Revert of Wrap ClassLiterals in DoExpressions instead of giving them BlockScopes. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 3 years, 8 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/interpreter/bytecode-generator.h ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 5fb120def80393b05a29466908ad279c33e77b1f..b1187a2789cf25ba683ed5505e7a61e202b5d0a7 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1361,6 +1361,18 @@
}
void BytecodeGenerator::VisitClassLiteral(ClassLiteral* expr) {
+ if (expr->scope()->ContextLocalCount() > 0) {
+ VisitNewLocalBlockContext(expr->scope());
+ ContextScope scope(this, expr->scope());
+ VisitDeclarations(expr->scope()->declarations());
+ VisitClassLiteralContents(expr);
+ } else {
+ VisitDeclarations(expr->scope()->declarations());
+ VisitClassLiteralContents(expr);
+ }
+}
+
+void BytecodeGenerator::VisitClassLiteralContents(ClassLiteral* expr) {
VisitClassLiteralForRuntimeDefinition(expr);
// Load the "prototype" from the constructor.
« no previous file with comments | « src/interpreter/bytecode-generator.h ('k') | src/parsing/parameter-initializer-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698