Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: src/mips/codegen-mips.cc

Issue 1218743010: MIPS: Avoid use of a0 as return address in jalr. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
}
« no previous file with comments | « src/mips/builtins-mips.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698