Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index c9c8eafc470b6e5c05e1f14392282abce7c453b5..94889277252270021172b684d47c3b7ba1a7e7e4 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -2565,6 +2565,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
FieldMemOperand(r0, 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(); |
@@ -2587,7 +2591,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: |
@@ -2620,6 +2625,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()); |
} |