Index: src/arm64/full-codegen-arm64.cc |
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc |
index 42254d6271d0783fbe771d444ad6f67b4224d6b9..fa79cfd012238e122e707a28af23ff626ae496d9 100644 |
--- a/src/arm64/full-codegen-arm64.cc |
+++ b/src/arm64/full-codegen-arm64.cc |
@@ -2255,6 +2255,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
FieldMemOperand(x0, JSFunction::kPrototypeOrInitialMapOffset)); |
__ Push(scratch); |
+ // store_slot_index points to the vector ic slot for the next store ic used. |
+ // ClassLiteral::ComputeFeedbackRequirements controls the allocation of slots |
+ // and must be updated if the number of store ics emitted here changes. |
+ int store_slot_index = 0; |
for (int i = 0; i < lit->properties()->length(); i++) { |
ObjectLiteral::Property* property = lit->properties()->at(i); |
Expression* value = property->value(); |
@@ -2277,7 +2281,8 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
} |
VisitForStackValue(value); |
- EmitSetHomeObjectIfNeeded(value, 2); |
+ EmitSetHomeObjectIfNeeded(value, 2, |
+ lit->SlotForHomeObject(value, &store_slot_index)); |
switch (property->kind()) { |
case ObjectLiteral::Property::CONSTANT: |
@@ -2310,6 +2315,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
// constructor |
__ CallRuntime(Runtime::kToFastProperties, 1); |
+ |
+ // Verify that compilation exactly consumed the number of store ic slots that |
+ // the ClassLiteral node had to offer. |
+ DCHECK(!FLAG_vector_stores || store_slot_index == lit->slot_count()); |
} |