PPC: [compiler] No need to push literal index in VisitArrayLiteral.
Port 9846f386f0
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}
This commit is contained in:
parent
67c036c16b
commit
443fb4de8e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user