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 01d7f5d8d9fa5d593aedd5a664478d4d60c9f899..aeee70af04f94a369a2a83e6de1d9fed4028db02 100644 |
--- a/src/compiler/mips64/code-generator-mips64.cc |
+++ b/src/compiler/mips64/code-generator-mips64.cc |
@@ -2281,8 +2281,7 @@ void CodeGenerator::AssembleConstructFrame() { |
} |
} |
- |
-void CodeGenerator::AssembleReturn() { |
+void CodeGenerator::AssembleReturn(InstructionOperand* pop) { |
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
// Restore GP registers. |
@@ -2310,6 +2309,15 @@ void CodeGenerator::AssembleReturn() { |
} |
} |
int pop_count = static_cast<int>(descriptor->StackParameterCount()); |
+ Mips64OperandConverter g(this, nullptr); |
+ if (pop->IsImmediate()) { |
+ DCHECK_EQ(Constant::kInt32, g.ToConstant(pop).type()); |
+ pop_count += g.ToConstant(pop).ToInt32(); |
+ } else { |
+ Register pop_reg = g.ToRegister(pop); |
+ __ sll(pop_reg, pop_reg, Operand(kPointerSizeLog2)); |
+ __ addu(sp, sp, Operand(pop_reg)); |
+ } |
if (pop_count != 0) { |
__ DropAndRet(pop_count); |
} else { |