MIPS32: Move code from RA to T9 in longjump
Do not use the return address. It should not be clobbered as we
may need it, e.g., for single-frame deopt.
This fixes following tests:
* 449-checker-bce
* 534-checker-bce-deoptimization
* 535-deopt-and-inlining
Change-Id: Ic94a2897c7336da094a8937ab1bc4a02a680de53
diff --git a/runtime/arch/mips/context_mips.cc b/runtime/arch/mips/context_mips.cc
index 4dedb33..375a03a 100644
--- a/runtime/arch/mips/context_mips.cc
+++ b/runtime/arch/mips/context_mips.cc
@@ -28,11 +28,11 @@
std::fill_n(gprs_, arraysize(gprs_), nullptr);
std::fill_n(fprs_, arraysize(fprs_), nullptr);
gprs_[SP] = &sp_;
- gprs_[RA] = &ra_;
+ gprs_[T9] = &t9_;
gprs_[A0] = &arg0_;
// Initialize registers with easy to spot debug values.
sp_ = MipsContext::kBadGprBase + SP;
- ra_ = MipsContext::kBadGprBase + RA;
+ t9_ = MipsContext::kBadGprBase + T9;
arg0_ = 0;
}
diff --git a/runtime/arch/mips/context_mips.h b/runtime/arch/mips/context_mips.h
index f1e2905..7dcff63 100644
--- a/runtime/arch/mips/context_mips.h
+++ b/runtime/arch/mips/context_mips.h
@@ -41,7 +41,7 @@
}
void SetPC(uintptr_t new_pc) OVERRIDE {
- SetGPR(RA, new_pc);
+ SetGPR(T9, new_pc);
}
bool IsAccessibleGPR(uint32_t reg) OVERRIDE {
@@ -86,9 +86,10 @@
// Pointers to registers in the stack, initialized to null except for the special cases below.
uintptr_t* gprs_[kNumberOfCoreRegisters];
uint32_t* fprs_[kNumberOfFRegisters];
- // Hold values for sp and ra (return address) if they are not located within a stack frame, as
- // well as the first argument.
- uintptr_t sp_, ra_, arg0_;
+ // Hold values for sp and t9 if they are not located within a stack frame. We use t9 for the
+ // PC (as ra is required to be valid for single-frame deopt and must not be clobbered). We
+ // also need the first argument for single-frame deopt.
+ uintptr_t sp_, t9_, arg0_;
};
} // namespace mips
} // namespace art
diff --git a/runtime/arch/mips/quick_entrypoints_mips.S b/runtime/arch/mips/quick_entrypoints_mips.S
index ba58c3f..0691f2a 100644
--- a/runtime/arch/mips/quick_entrypoints_mips.S
+++ b/runtime/arch/mips/quick_entrypoints_mips.S
@@ -374,7 +374,7 @@
lw $ra, 124($a0)
lw $a0, 16($a0)
move $v0, $zero # clear result registers r0 and r1
- jalr $zero, $ra # do long jump
+ jalr $zero, $t9 # do long jump
move $v1, $zero
END art_quick_do_long_jump
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index 5bbbbc1..6ce3d94 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -441,11 +441,8 @@
# Known broken tests for the mips32 optimizing compiler backend.
TEST_ART_BROKEN_OPTIMIZING_MIPS_RUN_TESTS := \
441-checker-inliner \
- 449-checker-bce \
510-checker-try-catch \
521-checker-array-set-null \
- 529-checker-unresolved \
- 534-checker-bce-deoptimization \
536-checker-intrinsic-optimization \
ifeq (mips,$(TARGET_ARCH))