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 46516e47cacd57dbb215dbd5395a45ef05521ee9..4670685992e583f9f08a4354619c13910fb1310c 100644 |
--- a/src/compiler/ppc/instruction-selector-ppc.cc |
+++ b/src/compiler/ppc/instruction-selector-ppc.cc |
@@ -1434,9 +1434,10 @@ void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
} |
-void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
+void InstructionSelector::VisitCall(Node* node, BasicBlock* handler, |
+ CallMode call_mode) { |
PPCOperandGenerator g(this); |
- const CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node); |
+ const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); |
FrameStateDescriptor* frame_state_descriptor = NULL; |
if (descriptor->NeedsFrameState()) { |
@@ -1466,14 +1467,15 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
} |
// Select the appropriate opcode based on the call type. |
+ bool is_tail_call = call_mode == TAIL_CALL; |
InstructionCode opcode; |
switch (descriptor->kind()) { |
case CallDescriptor::kCallCodeObject: { |
- opcode = kArchCallCodeObject; |
+ opcode = is_tail_call ? kArchTailCallCodeObject : kArchCallCodeObject; |
break; |
} |
case CallDescriptor::kCallJSFunction: |
- opcode = kArchCallJSFunction; |
+ opcode = is_tail_call ? kArchTailCallJSFunction : kArchCallJSFunction; |
break; |
default: |
UNREACHABLE(); |
@@ -1482,11 +1484,12 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
opcode |= MiscField::encode(flags); |
// Emit the call instruction. |
+ size_t size = is_tail_call ? 0 : buffer.outputs.size(); |
InstructionOperand* first_output = |
- buffer.outputs.size() > 0 ? &buffer.outputs.front() : NULL; |
+ size > 0 ? &buffer.outputs.front() : nullptr; |
Instruction* call_instr = |
- Emit(opcode, buffer.outputs.size(), first_output, |
- buffer.instruction_args.size(), &buffer.instruction_args.front()); |
+ Emit(opcode, size, first_output, buffer.instruction_args.size(), |
+ &buffer.instruction_args.front()); |
call_instr->MarkAsCall(); |
} |