Commit 443fb4de authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [compiler] No need to push literal index in VisitArrayLiteral.

Port 9846f386

Original commit message:
    The literal index is being pushed onto the stack while evaluating
    the non-constant subexpressions, but never used in fullcodegen (and
    hence not used in the optimizing compilers).

R=bmeurer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#32229}
parent 67c036c1
......@@ -1730,14 +1730,13 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
if (!result_saved) {
__ push(r3);
__ Push(Smi::FromInt(expr->literal_index()));
result_saved = true;
}
VisitForAccumulatorValue(subexpr);
__ LoadSmiLiteral(StoreDescriptor::NameRegister(),
Smi::FromInt(array_index));
__ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, kPointerSize));
__ LoadP(StoreDescriptor::ReceiverRegister(), MemOperand(sp, 0));
EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
Handle<Code> ic =
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
......@@ -1752,7 +1751,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
// (inclusive) and these elements gets appended to the array. Note that the
// number elements an iterable produces is unknown ahead of time.
if (array_index < length && result_saved) {
__ Drop(1); // literal index
__ Pop(r3);
result_saved = false;
}
......@@ -1773,7 +1771,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
}
if (result_saved) {
__ Drop(1); // literal index
context()->PlugTOS();
} else {
context()->Plug(r3);
......
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