Chromium Code Reviews| Index: src/ia32/full-codegen-ia32.cc |
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
| index 18729c98392be87c0b8cc0935f3cda362fffcb2a..7fcbbcd8e3a6f8ac464cc1fb2d9202c452136b0c 100644 |
| --- a/src/ia32/full-codegen-ia32.cc |
| +++ b/src/ia32/full-codegen-ia32.cc |
| @@ -2477,6 +2477,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { |
| __ mov(scratch, FieldOperand(eax, JSFunction::kPrototypeOrInitialMapOffset)); |
| __ Push(scratch); |
| + // store_slot_index points to the vector ic slot for the next store ic used. |
|
Jakob Kummerow
2015/06/08 08:27:28
s/ic/IC/g
mvstanton
2015/06/08 08:39:13
Done, also in a similar comment in VisitObjectLite
|
| + // 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(); |
| @@ -2498,7 +2502,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: |
| @@ -2526,6 +2531,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()); |
| } |