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

Unified Diff: src/full-codegen/ppc/full-codegen-ppc.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/ppc/full-codegen-ppc.cc
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc
index 77ac6b68f8740cc17bcfe7e1c7ede17ce728302c..346c187a7fba5f3d9a9da12bb68ccabb8870db8a 100644
--- a/src/full-codegen/ppc/full-codegen-ppc.cc
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc
@@ -1991,6 +1991,19 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
ClassLiteral::Property* property = lit->properties()->at(i);
Expression* value = property->value();
+ if (property->kind() == ClassLiteral::Property::FIELD &&
+ !property->is_static()) {
+ // This just does the ToName call on the field name and stores it in a
+ // variable (a proxy for which is the value() of this property)
+ DCHECK(property->value()->IsVariableProxy());
+ Variable* variable = property->value()->AsVariableProxy()->var();
+ VisitForStackValue(property->key());
+ EmitVariableAssignment(variable, Token::INIT,
+ FeedbackVectorSlot::Invalid());
+ DropOperands(1);
+ continue;
+ }
+
Register scratch = r4;
if (property->is_static()) {
__ LoadP(scratch, MemOperand(sp, kPointerSize)); // constructor
@@ -2032,8 +2045,11 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
break;
case ClassLiteral::Property::FIELD:
- default:
- UNREACHABLE();
+ DCHECK(property->is_static());
+ PushOperand(Smi::FromInt(DONT_ENUM));
+ PushOperand(Smi::FromInt(property->NeedsSetFunctionName()));
+ CallRuntimeWithOperands(Runtime::kDefineDataPropertyInLiteral);
+ break;
}
}
}

Powered by Google App Engine
This is Rietveld 408576698