From e036a348707b26b1048298ba52fafbd2072dce75 Mon Sep 17 00:00:00 2001 From: mbrandy Date: Mon, 8 Jun 2015 11:23:09 -0700 Subject: [PATCH] PPC: Vector ICs: ClassLiterals need to allocate a vector slot for home objects. Port b27016b78a7dd58dc682eed51500ba603b3e46b0 R=mvstanton@chromium.org, dstence@us.ibm.com, michael_dawson@ca.ibm.com BUG= Review URL: https://codereview.chromium.org/1161893003 Cr-Commit-Position: refs/heads/master@{#28849} --- src/ppc/full-codegen-ppc.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ppc/full-codegen-ppc.cc b/src/ppc/full-codegen-ppc.cc index db7c401..0145d00 100644 --- a/src/ppc/full-codegen-ppc.cc +++ b/src/ppc/full-codegen-ppc.cc @@ -1637,9 +1637,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); @@ -2560,6 +2560,10 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { FieldMemOperand(r3, 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(); @@ -2582,7 +2586,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: @@ -2615,6 +2620,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()); } -- 2.7.4