Index: src/compiler/mips64/code-generator-mips64.cc |
diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc |
index 13ee9d0b35058637d40cfe56305a27bf0bee92d9..117e8cafd0b2d1dcbfbbcdd90617e7d64a6999e2 100644 |
--- a/src/compiler/mips64/code-generator-mips64.cc |
+++ b/src/compiler/mips64/code-generator-mips64.cc |
@@ -446,11 +446,21 @@ FPUCondition FlagsConditionToConditionCmpFPU(bool& predicate, |
} while (0) |
-void CodeGenerator::AssembleDeconstructActivationRecord() { |
+void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
int stack_slots = frame()->GetSpillSlotCount(); |
+ int stack_pointer_delta = 0; |
if (descriptor->IsJSFunctionCall() || stack_slots > 0) { |
- __ LeaveFrame(StackFrame::MANUAL); |
+ __ mov(sp, fp); |
+ __ ld(fp, MemOperand(sp, 0 * kPointerSize)); |
+ __ ld(ra, MemOperand(sp, 1 * kPointerSize)); |
+ stack_pointer_delta = 2 * kPointerSize; |
+ } |
+ if (stack_param_delta < 0) { |
+ stack_pointer_delta += -stack_param_delta * kPointerSize; |
+ } |
+ if (stack_pointer_delta != 0) { |
+ __ daddiu(sp, sp, stack_pointer_delta); |
} |
} |
@@ -474,7 +484,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
} |
case kArchTailCallCodeObject: { |
- AssembleDeconstructActivationRecord(); |
+ int stack_param_delta = i.InputInt32(instr->InputCount() - 1); |
+ AssembleDeconstructActivationRecord(stack_param_delta); |
if (instr->InputAt(0)->IsImmediate()) { |
__ Jump(Handle<Code>::cast(i.InputHeapObject(0)), |
RelocInfo::CODE_TARGET); |
@@ -504,7 +515,8 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
__ ld(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset)); |
__ Assert(eq, kWrongFunctionContext, cp, Operand(kScratchReg)); |
} |
- AssembleDeconstructActivationRecord(); |
+ int stack_param_delta = i.InputInt32(instr->InputCount() - 1); |
+ AssembleDeconstructActivationRecord(stack_param_delta); |
__ ld(at, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
__ Jump(at); |
break; |