Chromium Code Reviews

Unified Diff: src/full-codegen/full-codegen.h

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.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.h
diff --git a/src/full-codegen/full-codegen.h b/src/full-codegen/full-codegen.h
index cb2edaf157ea4d08de1d6a510522ea4bc57431e8..876ce6c0b977bc74e60aa79ea7533d6a2d781919 100644
--- a/src/full-codegen/full-codegen.h
+++ b/src/full-codegen/full-codegen.h
@@ -199,6 +199,23 @@
}
return previous_;
}
+ };
+
+ // A class literal expression
+ class NestedClassLiteral : public NestedStatement {
+ public:
+ NestedClassLiteral(FullCodeGenerator* codegen, ClassLiteral* lit)
+ : NestedStatement(codegen),
+ needs_context_(lit->scope() != nullptr &&
+ lit->scope()->NeedsContext()) {}
+
+ NestedStatement* Exit(int* context_length) override {
+ if (needs_context_) ++(*context_length);
+ return previous_;
+ }
+
+ private:
+ const bool needs_context_;
};
class DeferredCommands {
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine