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

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

Issue 2330473002: Class fields, part 3 (backends)
Patch Set: clean up test properly Created 4 years, 3 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/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 6182094e821933230802568745df22e03b9b5872..d809304d774cef40b671b1d3013395be8af59960 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -1528,6 +1528,17 @@ void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
PrepareForBailoutForId(lit->CreateLiteralId(), BailoutState::TOS_REGISTER);
PushOperand(result_register());
+ // TODO(bakkot) This shouldn't be necessary; I just couldn't figure out how to
+ // invoke the function literal with appropriate home object and receiver
+ // (mainly because of FeedbackVector check failures which are totally opaque
+ // to me)
+ VariableProxy* static_initializer_proxy = lit->static_initializer_proxy();
+ if (static_initializer_proxy != nullptr) {
+ Variable* variable = static_initializer_proxy->var();
+ EmitVariableAssignment(variable, Token::INIT,
+ FeedbackVectorSlot::Invalid());
+ }
+
// Load the "prototype" from the constructor.
__ Move(LoadDescriptor::ReceiverRegister(), result_register());
__ LoadRoot(LoadDescriptor::NameRegister(), Heap::kprototype_stringRootIndex);

Powered by Google App Engine
This is Rietveld 408576698