Index: src/compiler/mips64/instruction-selector-mips64.cc |
diff --git a/src/compiler/mips64/instruction-selector-mips64.cc b/src/compiler/mips64/instruction-selector-mips64.cc |
index cd99a7cf0aefd49338e79a6120f8fab4d55521af..188c915bf07b0024477bbab2ae747f7518af4457 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -716,20 +716,10 @@ void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) { |
} |
-void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
+void InstructionSelector::EmitPrepareArguments(NodeVector* arguments, |
+ const CallDescriptor* descriptor, |
+ Node* node) { |
Mips64OperandGenerator g(this); |
- const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node); |
- |
- FrameStateDescriptor* frame_state_descriptor = nullptr; |
- if (descriptor->NeedsFrameState()) { |
- frame_state_descriptor = GetFrameStateDescriptor( |
- node->InputAt(static_cast<int>(descriptor->InputCount()))); |
- } |
- |
- CallBuffer buffer(zone(), descriptor, frame_state_descriptor); |
- |
- // Compute InstructionOperands for inputs and outputs. |
- InitializeCallBuffer(node, &buffer, true, true); |
// Prepare for C function call. |
if (descriptor->IsCFunctionCall()) { |
@@ -739,7 +729,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
// Poke any stack arguments. |
int slot = kCArgSlotCount; |
- for (Node* input : buffer.pushed_nodes) { |
+ for (Node* input : (*arguments)) { |
Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input), |
g.TempImmediate(slot << kPointerSizeLog2)); |
++slot; |
@@ -750,51 +740,13 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { |
Emit(kMips64StackClaim, g.NoOutput(), |
g.TempImmediate(push_count << kPointerSizeLog2)); |
} |
- for (size_t n = 0; n < buffer.pushed_nodes.size(); ++n) { |
- if (Node* input = buffer.pushed_nodes[n]) { |
+ for (size_t n = 0; n < arguments->size(); ++n) { |
+ if (Node* input = (*arguments)[n]) { |
Emit(kMips64StoreToStackSlot, g.NoOutput(), g.UseRegister(input), |
g.TempImmediate(static_cast<int>(n << kPointerSizeLog2))); |
} |
} |
} |
- |
- // Pass label of exception handler block. |
- CallDescriptor::Flags flags = descriptor->flags(); |
- if (handler) { |
- DCHECK_EQ(IrOpcode::kIfException, handler->front()->opcode()); |
- IfExceptionHint hint = OpParameter<IfExceptionHint>(handler->front()); |
- if (hint == IfExceptionHint::kLocallyCaught) { |
- flags |= CallDescriptor::kHasLocalCatchHandler; |
- } |
- flags |= CallDescriptor::kHasExceptionHandler; |
- buffer.instruction_args.push_back(g.Label(handler)); |
- } |
- |
- // Select the appropriate opcode based on the call type. |
- InstructionCode opcode = kArchNop; |
- switch (descriptor->kind()) { |
- case CallDescriptor::kCallAddress: |
- opcode = |
- kArchCallCFunction | |
- MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
- break; |
- case CallDescriptor::kCallCodeObject: |
- opcode = kArchCallCodeObject | MiscField::encode(flags); |
- break; |
- case CallDescriptor::kCallJSFunction: |
- opcode = kArchCallJSFunction | MiscField::encode(flags); |
- break; |
- case CallDescriptor::kLazyBailout: |
- opcode = kArchLazyBailout | MiscField::encode(flags); |
- break; |
- } |
- opcode |= MiscField::encode(flags); |
- |
- // Emit the call instruction. |
- size_t const output_count = buffer.outputs.size(); |
- auto* outputs = output_count ? &buffer.outputs.front() : nullptr; |
- Emit(opcode, output_count, outputs, buffer.instruction_args.size(), |
- &buffer.instruction_args.front())->MarkAsCall(); |
} |