Index: src/x64/full-codegen-x64.cc |
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc |
index c384a4a87ee7c533455ad3c742a1ae731d29b461..66632716e40ad2d6016a29510f993b2919de3fd6 100644 |
--- a/src/x64/full-codegen-x64.cc |
+++ b/src/x64/full-codegen-x64.cc |
@@ -1644,9 +1644,9 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
AccessorTable accessor_table(zone()); |
int property_index = 0; |
- // store_slot_index points to the vector ic slot for the next store ic used. |
+ // store_slot_index points to the vector IC slot for the next store IC used. |
// ObjectLiteral::ComputeFeedbackRequirements controls the allocation of slots |
- // and must be updated if the number of store ics emitted here changes. |
+ // and must be updated if the number of store ICs emitted here changes. |
int store_slot_index = 0; |
for (; property_index < expr->properties()->length(); property_index++) { |
ObjectLiteral::Property* property = expr->properties()->at(property_index); |
@@ -2472,6 +2472,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
__ movp(scratch, FieldOperand(rax, 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(); |
@@ -2493,7 +2497,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: |
@@ -2524,6 +2529,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()); |
} |