Commit 0f51a350 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: VectorICs: use a vector slot to aid in array literal processing.

Port f2f46aff

Original commit message:
    The lack of a vector slot for the keyed store operation in filling in
    non-constant array literal properties led to undesirable contortions in
    compilers downwind of full-codegen. The use of a single slot to initialize all
    the array elements is sufficient.

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

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

Cr-Commit-Position: refs/heads/master@{#31261}
parent d317145d
...@@ -1715,7 +1715,6 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1715,7 +1715,6 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
Comment cmnt(masm_, "[ ArrayLiteral"); Comment cmnt(masm_, "[ ArrayLiteral");
expr->BuildConstantElements(isolate());
Handle<FixedArray> constant_elements = expr->constant_elements(); Handle<FixedArray> constant_elements = expr->constant_elements();
bool has_fast_elements = bool has_fast_elements =
IsFastObjectElementsKind(expr->constant_elements_kind()); IsFastObjectElementsKind(expr->constant_elements_kind());
...@@ -1764,7 +1763,16 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { ...@@ -1764,7 +1763,16 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
} }
VisitForAccumulatorValue(subexpr); VisitForAccumulatorValue(subexpr);
if (has_fast_elements) { if (FLAG_vector_stores) {
__ LoadSmiLiteral(StoreDescriptor::NameRegister(),
Smi::FromInt(array_index));
__ LoadP(StoreDescriptor::ReceiverRegister(),
MemOperand(sp, kPointerSize));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
CallIC(ic);
} else if (has_fast_elements) {
int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); int offset = FixedArray::kHeaderSize + (array_index * kPointerSize);
__ LoadP(r8, MemOperand(sp, kPointerSize)); // Copy of array literal. __ LoadP(r8, MemOperand(sp, kPointerSize)); // Copy of array literal.
__ LoadP(r4, FieldMemOperand(r8, JSObject::kElementsOffset)); __ LoadP(r4, FieldMemOperand(r8, JSObject::kElementsOffset));
......
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