ART: Use jalr instead of jr for Mips
Use the jalr instruction instead of jr in stubs and compiled code.
Change-Id: Idacc5167a5bb0113dc2e7716e4767e5ed07b5e0b
diff --git a/compiler/dex/quick/mips/assemble_mips.cc b/compiler/dex/quick/mips/assemble_mips.cc
index 0d1d9bf..c48833b 100644
--- a/compiler/dex/quick/mips/assemble_mips.cc
+++ b/compiler/dex/quick/mips/assemble_mips.cc
@@ -434,7 +434,7 @@
* anchor:
* ori rAT, rAT, ((target-anchor) & 0xffff)
* addu rAT, rAT, rRA
- * jr rAT
+ * jalr rZERO, rAT
* hop:
*
* Orig unconditional branch
@@ -448,7 +448,7 @@
* anchor:
* ori rAT, rAT, ((target-anchor) & 0xffff)
* addu rAT, rAT, rRA
- * jr rAT
+ * jalr rZERO, rAT
*
*
* NOTE: An out-of-range bal isn't supported because it should
@@ -497,8 +497,8 @@
InsertLIRBefore(lir, delta_lo);
LIR* addu = RawLIR(dalvik_offset, kMipsAddu, rAT, rAT, rRA);
InsertLIRBefore(lir, addu);
- LIR* jr = RawLIR(dalvik_offset, kMipsJr, rAT);
- InsertLIRBefore(lir, jr);
+ LIR* jalr = RawLIR(dalvik_offset, kMipsJalr, rZERO, rAT);
+ InsertLIRBefore(lir, jalr);
if (!unconditional) {
InsertLIRBefore(lir, hop_target);
}
diff --git a/compiler/dex/quick/mips/call_mips.cc b/compiler/dex/quick/mips/call_mips.cc
index 3bb81bf..51a8c98 100644
--- a/compiler/dex/quick/mips/call_mips.cc
+++ b/compiler/dex/quick/mips/call_mips.cc
@@ -58,7 +58,7 @@
* bne r_val, r_key, loop
* lw r_disp, -4(r_base)
* addu rRA, r_disp
- * jr rRA
+ * jalr rZERO, rRA
* done:
*
*/
@@ -136,7 +136,7 @@
* bound check -> done
* lw r_disp, [rRA, r_val]
* addu rRA, r_disp
- * jr rRA
+ * jalr rZERO, rRA
* done:
*/
void MipsMir2Lir::GenLargePackedSwitch(MIR* mir, DexOffset table_offset, RegLocation rl_src) {
diff --git a/compiler/dex/quick/mips/utility_mips.cc b/compiler/dex/quick/mips/utility_mips.cc
index 18f1cde..adb9270 100644
--- a/compiler/dex/quick/mips/utility_mips.cc
+++ b/compiler/dex/quick/mips/utility_mips.cc
@@ -125,7 +125,7 @@
opcode = kMipsJalr;
break;
case kOpBx:
- return NewLIR1(kMipsJr, r_dest_src.GetReg());
+ return NewLIR2(kMipsJalr, rZERO, r_dest_src.GetReg());
break;
default:
LOG(FATAL) << "Bad case in OpReg";