Compiler cleanup
o Added slow path for string resolution
o Removed dead throw internal and runtime error
o Restructured debug and optimization disable flags for make it easier
for command-line option support.
o Removed/converted #if 1/0 blocks
Change-Id: I65fc561a55437b3f74d0dfff5af87f938008d70e
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 6be9f76..922e25b 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -14,7 +14,8 @@
* limitations under the License.
*/
-#define DISPLAY_MISSING_TARGETS 1
+#define DISPLAY_MISSING_TARGETS (cUnit->enableDebug & \
+ (1 << kDebugDisplayMissingTargets))
STATIC const RegLocation badLoc = {kLocDalvikFrame, 0, 0, INVALID_REG,
INVALID_REG, INVALID_SREG, 0,
@@ -922,7 +923,6 @@
return callState;
}
-#ifdef DISPLAY_MISSING_TARGETS
// Debugging routine - if null target, branch to DebugMe
STATIC void genShowTarget(CompilationUnit* cUnit)
{
@@ -933,7 +933,6 @@
target->defMask = -1;
branchOver->generic.target = (LIR*)target;
}
-#endif
STATIC void genInvokeStaticDirect(CompilationUnit* cUnit, MIR* mir,
bool direct, bool range)
@@ -959,9 +958,9 @@
while (callState >= 0) {
callState = nextCallInsn(cUnit, mir, dInsn, callState, NULL);
}
-#ifdef DISPLAY_MISSING_TARGETS
- genShowTarget(cUnit);
-#endif
+ if (DISPLAY_MISSING_TARGETS) {
+ genShowTarget(cUnit);
+ }
opReg(cUnit, kOpBlx, rLR);
oatClobberCalleeSave(cUnit);
}
@@ -992,9 +991,9 @@
while (callState >= 0) {
callState = nextInterfaceCallInsn(cUnit, mir, dInsn, callState, NULL);
}
-#ifdef DISPLAY_MISSING_TARGETS
- genShowTarget(cUnit);
-#endif
+ if (DISPLAY_MISSING_TARGETS) {
+ genShowTarget(cUnit);
+ }
opReg(cUnit, kOpBlx, rLR);
oatClobberCalleeSave(cUnit);
}
@@ -1045,9 +1044,9 @@
while (callState >= 0) {
callState = nextCallInsn(cUnit, mir, dInsn, callState, rollback);
}
-#ifdef DISPLAY_MISSING_TARGETS
- genShowTarget(cUnit);
-#endif
+ if (DISPLAY_MISSING_TARGETS) {
+ genShowTarget(cUnit);
+ }
opReg(cUnit, kOpBlx, rLR);
oatClobberCalleeSave(cUnit);
}
@@ -1085,9 +1084,9 @@
while (callState >= 0) {
callState = nextCallInsn(cUnit, mir, dInsn, callState, rollback);
}
-#ifdef DISPLAY_MISSING_TARGETS
- genShowTarget(cUnit);
-#endif
+ if (DISPLAY_MISSING_TARGETS) {
+ genShowTarget(cUnit);
+ }
opReg(cUnit, kOpBlx, rLR);
oatClobberCalleeSave(cUnit);
}
@@ -2108,16 +2107,6 @@
funcOffset =
OFFSETOF_MEMBER(Thread, pThrowNegArraySizeFromCode);
break;
- case kArmThrowInternalError:
- genRegCopy(cUnit, r0, v1);
- funcOffset =
- OFFSETOF_MEMBER(Thread, pThrowInternalErrorFromCode);
- break;
- case kArmThrowRuntimeException:
- genRegCopy(cUnit, r0, v1);
- funcOffset =
- OFFSETOF_MEMBER(Thread, pThrowRuntimeExceptionFromCode);
- break;
case kArmThrowNoSuchMethod:
genRegCopy(cUnit, r0, v1);
funcOffset =