Index: src/compiler/ppc/instruction-selector-ppc.cc |
diff --git a/src/compiler/ppc/instruction-selector-ppc.cc b/src/compiler/ppc/instruction-selector-ppc.cc |
index bff41c3609c89302baa8e32f8d1a4467ee866400..194b95f90ddf03159837f7728851df3cecdc5421 100644 |
--- a/src/compiler/ppc/instruction-selector-ppc.cc |
+++ b/src/compiler/ppc/instruction-selector-ppc.cc |
@@ -1474,14 +1474,16 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
} |
} else { |
// Push any stack arguments. |
- int num_slots = buffer.pushed_nodes.size(); |
+ int num_slots = static_cast<int>(descriptor->StackParameterCount()); |
int slot = 0; |
- for (Node* node : buffer.pushed_nodes) { |
+ for (Node* input : buffer.pushed_nodes) { |
+ // Skip any alignment holes in pushed nodes. |
+ if (input == nullptr) continue; |
if (slot == 0) { |
- Emit(kPPC_PushFrame, g.NoOutput(), g.UseRegister(node), |
+ Emit(kPPC_PushFrame, g.NoOutput(), g.UseRegister(input), |
g.TempImmediate(num_slots)); |
} else { |
- Emit(kPPC_StoreToStackSlot, g.NoOutput(), g.UseRegister(node), |
+ Emit(kPPC_StoreToStackSlot, g.NoOutput(), g.UseRegister(input), |
g.TempImmediate(slot)); |
} |
++slot; |
@@ -1578,8 +1580,9 @@ void InstructionSelector::VisitTailCall(Node* node) { |
InitializeCallBuffer(node, &buffer, true, false); |
// Push any stack arguments. |
- for (Node* node : base::Reversed(buffer.pushed_nodes)) { |
- Emit(kPPC_Push, g.NoOutput(), g.UseRegister(node)); |
+ for (Node* input : base::Reversed(buffer.pushed_nodes)) { |
+ if (input == nullptr) continue; |
+ Emit(kPPC_Push, g.NoOutput(), g.UseRegister(input)); |
} |
// Select the appropriate opcode based on the call type. |