| Index: src/mips/codegen-mips.cc
|
| diff --git a/src/mips/codegen-mips.cc b/src/mips/codegen-mips.cc
|
| index 23780d8b2597679c747b7eefa78bbcd34e4685de..956407bc578b7cc3633aa9282e0b8ba504e0dae3 100644
|
| --- a/src/mips/codegen-mips.cc
|
| +++ b/src/mips/codegen-mips.cc
|
| @@ -1252,8 +1252,9 @@ void Code::PatchPlatformCodeAge(Isolate* isolate,
|
| t9,
|
| Operand(reinterpret_cast<uint32_t>(stub->instruction_start())),
|
| CONSTANT_SIZE);
|
| - patcher.masm()->nop(); // Prevent jalr to jal optimization.
|
| - patcher.masm()->jalr(t9, a0);
|
| + // Save the function's original return address.
|
| + patcher.masm()->mov(at, ra); // This also prevents jalr->jal optimization.
|
| + patcher.masm()->jalr(t9);
|
| patcher.masm()->nop(); // Branch delay slot nop.
|
| patcher.masm()->nop(); // Pad the empty space.
|
| }
|
|
|