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

Unified Diff: src/mips/macro-assembler-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/codegen-mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
index f554b0c1efc84757d5edc7bd2923272dc1522598..8ca73e60e6cc9ab26736ffd5484e3e553a441853 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -4892,8 +4892,9 @@ void MacroAssembler::Prologue(bool code_pre_aging) {
li(t9,
Operand(reinterpret_cast<uint32_t>(stub->instruction_start())),
CONSTANT_SIZE);
- nop(); // Prevent jalr to jal optimization.
- jalr(t9, a0);
+ // Save the function's original return address.
+ mov(at, ra); // This also prevents jalr->jal optimization.
+ jalr(t9);
nop(); // Branch delay slot nop.
nop(); // Pad the empty space.
} else {
« no previous file with comments | « src/mips/codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698