Disable use of R4 as a promotable register
When we are using implicit suspend checks we can potentially
use r4 as a register into which variables can be promoted. However
the runtime doesn't save this and thus will corrupt it. Not good.
This disables the promotion of r4 until we can figure out how
to make the runtime save it properly.
Change-Id: Ib95ce93579e1c364de5ecc8e728f2cb7990da77a
diff --git a/compiler/dex/quick/arm/target_arm.cc b/compiler/dex/quick/arm/target_arm.cc
index 5e9a8b0..1053a8f 100644
--- a/compiler/dex/quick/arm/target_arm.cc
+++ b/compiler/dex/quick/arm/target_arm.cc
@@ -562,7 +562,8 @@
// Keep special registers from being allocated
// Don't reserve the r4 if we are doing implicit suspend checks.
- bool no_suspend = NO_SUSPEND || !Runtime::Current()->ExplicitSuspendChecks();
+ // TODO: re-enable this when we can safely save r4 over the suspension code path.
+ bool no_suspend = NO_SUSPEND; // || !Runtime::Current()->ExplicitSuspendChecks();
for (int i = 0; i < num_reserved; i++) {
if (no_suspend && (ReservedRegs[i] == rARM_SUSPEND)) {
// Don't reserve the suspend register.