Commit 4292fa84 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Vector ICs: Turbofan vector store ic support

Port 17c8ffea

Original commit message:
Turbofan needs to pass vector slots around for named and keyed stores.
Also, the CL addresses a missing slot for ClassLiterals.

R=mvstanton@chromium.org, dstence@us.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1201983005

Cr-Commit-Position: refs/heads/master@{#29198}
parent 464f0538
...@@ -2548,7 +2548,8 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -2548,7 +2548,8 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
} }
void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit,
int* used_store_slots) {
// Constructor is in r3. // Constructor is in r3.
DCHECK(lit != NULL); DCHECK(lit != NULL);
__ push(r3); __ push(r3);
...@@ -2560,10 +2561,6 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { ...@@ -2560,10 +2561,6 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset)); FieldMemOperand(r3, JSFunction::kPrototypeOrInitialMapOffset));
__ push(scratch); __ 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++) { for (int i = 0; i < lit->properties()->length(); i++) {
ObjectLiteral::Property* property = lit->properties()->at(i); ObjectLiteral::Property* property = lit->properties()->at(i);
Expression* value = property->value(); Expression* value = property->value();
...@@ -2587,7 +2584,7 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { ...@@ -2587,7 +2584,7 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
VisitForStackValue(value); VisitForStackValue(value);
EmitSetHomeObjectIfNeeded(value, 2, EmitSetHomeObjectIfNeeded(value, 2,
lit->SlotForHomeObject(value, &store_slot_index)); lit->SlotForHomeObject(value, used_store_slots));
switch (property->kind()) { switch (property->kind()) {
case ObjectLiteral::Property::CONSTANT: case ObjectLiteral::Property::CONSTANT:
...@@ -2620,10 +2617,6 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) { ...@@ -2620,10 +2617,6 @@ void FullCodeGenerator::EmitClassDefineProperties(ClassLiteral* lit) {
// constructor // constructor
__ CallRuntime(Runtime::kToFastProperties, 1); __ 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());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment