Index: src/mips/lithium-codegen-mips.cc |
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc |
index ab08399a3c9e39b04e1d87394bc637ba78128be5..3cd89b8fea2b25ffdfa74d6da841ce2b364db2f5 100644 |
--- a/src/mips/lithium-codegen-mips.cc |
+++ b/src/mips/lithium-codegen-mips.cc |
@@ -2558,11 +2558,20 @@ void LCodeGen::DoReturn(LReturn* instr) { |
} |
} |
if (NeedsEagerFrame()) { |
- int32_t sp_delta = (GetParameterCount() + 1) * kPointerSize; |
__ mov(sp, fp); |
__ Pop(ra, fp); |
- if (!info()->IsStub()) { |
- __ Addu(sp, sp, Operand(sp_delta)); |
+ |
+ if (instr->has_constant_parameter_count()) { |
+ int parameter_count = ToInteger32(instr->constant_parameter_count()); |
+ int32_t sp_delta = (parameter_count + 1) * kPointerSize; |
+ if (sp_delta != 0) { |
+ __ Addu(sp, sp, Operand(sp_delta)); |
+ } |
+ } else { |
+ Register reg = ToRegister(instr->parameter_count()); |
+ __ Addu(reg, reg, Operand(1)); |
+ __ sll(at, reg, kPointerSizeLog2); |
+ __ Addu(sp, sp, at); |
} |
} |
__ Jump(ra); |