Index: src/mips/regexp-macro-assembler-mips.cc |
diff --git a/src/mips/regexp-macro-assembler-mips.cc b/src/mips/regexp-macro-assembler-mips.cc |
index 63e836f22f646af92ea25b05c79f53de24e7dcab..8cb8ce17f302a654c68f1cca46b195c702f7e18e 100644 |
--- a/src/mips/regexp-macro-assembler-mips.cc |
+++ b/src/mips/regexp-macro-assembler-mips.cc |
@@ -1244,13 +1244,14 @@ void RegExpCEntryStub::Generate(MacroAssembler* masm_) { |
if (stack_alignment < kPointerSize) stack_alignment = kPointerSize; |
// Stack is already aligned for call, so decrement by alignment |
// to make room for storing the return address. |
- __ Subu(sp, sp, Operand(stack_alignment)); |
- __ sw(ra, MemOperand(sp, 0)); |
- __ mov(a0, sp); |
+ __ Subu(sp, sp, Operand(stack_alignment + kCArgsSlotsSize)); |
+ const int return_address_offset = kCArgsSlotsSize; |
+ __ Addu(a0, sp, return_address_offset); |
+ __ sw(ra, MemOperand(a0, 0)); |
__ mov(t9, t1); |
__ Call(t9); |
- __ lw(ra, MemOperand(sp, 0)); |
- __ Addu(sp, sp, Operand(stack_alignment)); |
+ __ lw(ra, MemOperand(sp, return_address_offset)); |
+ __ Addu(sp, sp, Operand(stack_alignment + kCArgsSlotsSize)); |
__ Jump(ra); |
} |