From 34c77ad4fc67de52463544b78a35b86d15b496e4 Mon Sep 17 00:00:00 2001 From: buzbee Date: Wed, 11 Jan 2012 13:01:32 -0800 Subject: 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 --- src/compiler/codegen/arm/MethodCodegenDriver.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/compiler/codegen/arm/MethodCodegenDriver.cc') 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 -- cgit v1.2.3-59-g8ed1b