summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/arm/MethodCodegenDriver.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-01-11 13:01:32 -0800
committer buzbee <buzbee@google.com> 2012-01-11 14:01:54 -0800
commit34c77ad4fc67de52463544b78a35b86d15b496e4 (patch)
tree583a249e4c6d49473b4ecc6b9ac70273f5b0deac /src/compiler/codegen/arm/MethodCodegenDriver.cc
parentef94857c7a33c467c55ac45a6aeb064eb4b8b7c7 (diff)
Add stress-test mode for ResolveMethodFromCode
To force call to artResolveMethodFromCode prior to each virtual or super invoke, add (1 << kDebugExerciseResolveMethod) bit to the compiler's debug flags. Change-Id: If14e4bcc8073c8ac7a7a8d0d92bc49444528f77e
Diffstat (limited to 'src/compiler/codegen/arm/MethodCodegenDriver.cc')
-rw-r--r--src/compiler/codegen/arm/MethodCodegenDriver.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 33823ca22e..3f8d9005a3 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -715,7 +715,7 @@ STATIC int nextSuperCallInsnSP(CompilationUnit* cUnit, MIR* mir,
case 0: // Get the current Method* [sets r0]
loadCurrMethodDirect(cUnit, r0);
break;
- case 1: // Get method->dex_cache_resolved_methods_ [usr r0, set rLR]
+ case 1: // Get method->dex_cache_resolved_methods_ [uses r0, set rLR]
loadWordDisp(cUnit, r0,
Method::GetDexCacheResolvedMethodsOffset().Int32Value(), rLR);
break;
@@ -1078,6 +1078,16 @@ STATIC void genInvokeSuper(CompilationUnit* cUnit, MIR* mir)
// Explicit register usage
oatLockCallTemps(cUnit);
+
+ // For testing, force call to artResolveMethodFromCode & ignore result
+ if (EXERCISE_RESOLVE_METHOD) {
+ loadCurrMethodDirect(cUnit, r0);
+ loadWordDisp(cUnit, rSELF,
+ OFFSETOF_MEMBER(Thread, pResolveMethodFromCode), rLR);
+ loadConstant(cUnit, r1, dInsn->vB);
+ callRuntimeHelper(cUnit, rLR);
+ }
+
if (SLOW_INVOKE_PATH || baseMethod == NULL) {
Thread* thread = Thread::Current();
if (thread->IsExceptionPending()) { // clear any exception left by resolve method
@@ -1138,9 +1148,18 @@ STATIC void genInvokeVirtual(CompilationUnit* cUnit, MIR* mir)
false);
NextCallInsn nextCallInsn;
oatFlushAllRegs(cUnit); /* Everything to home location */
-
// Explicit register usage
oatLockCallTemps(cUnit);
+
+ // For testing, force call to artResolveMethodFromCode & ignore result
+ if (EXERCISE_RESOLVE_METHOD) {
+ loadCurrMethodDirect(cUnit, r0);
+ loadWordDisp(cUnit, rSELF,
+ OFFSETOF_MEMBER(Thread, pResolveMethodFromCode), rLR);
+ loadConstant(cUnit, r1, dInsn->vB);
+ callRuntimeHelper(cUnit, rLR);
+ }
+
if (SLOW_INVOKE_PATH || method == NULL) {
Thread* thread = Thread::Current();
if (thread->IsExceptionPending()) { // clear any exception left by resolve method