summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Cheng <bccheng@android.com>2010-03-05 15:27:21 -0800
committerBen Cheng <bccheng@android.com>2010-03-05 15:27:21 -0800
commit86717f79d9b018f4d69cc991075fa36611f234e5 (patch)
treec220e7b753c90860be933588b6bb27602dfe6c01
parent101cbfe486ad1744f666e924f600dd1b8cdecea7 (diff)
downloadandroid_dalvik-86717f79d9b018f4d69cc991075fa36611f234e5.tar.gz
android_dalvik-86717f79d9b018f4d69cc991075fa36611f234e5.tar.bz2
android_dalvik-86717f79d9b018f4d69cc991075fa36611f234e5.zip
Collect more JIT stats in the assert build.
New stuff includes breakdown of callsite types (ie monomorphic vs polymorphic vs monoporphic resolved to native), total time spent in JIT'ing, and average JIT time per compilation. Example output: D/dalvikvm( 840): 4042 compilations using 1976 + 329108 bytes D/dalvikvm( 840): Compiler arena uses 10 blocks (8100 bytes each) D/dalvikvm( 840): Compiler work queue length is 0/36 D/dalvikvm( 840): size if 8192, entries used is 4137 D/dalvikvm( 840): JIT: 4137 traces, 8192 slots, 1099 chains, 40 thresh, Non-blocking D/dalvikvm( 840): JIT: Lookups: 1128780 hits, 168564 misses; 179520 normal, 6 punt D/dalvikvm( 840): JIT: noChainExit: 528464 IC miss, 194708 interp callsite, 0 switch overflow D/dalvikvm( 840): JIT: Invoke: 507 mono, 988 poly, 72 native, 1038 return D/dalvikvm( 840): JIT: Total compilation time: 2342 ms D/dalvikvm( 840): JIT: Avg unit compilation time: 579 us D/dalvikvm( 840): JIT: 3357 Translation chains, 97 interp stubs D/dalvikvm( 840): dalvik.vm.jit.op = 0-2,4-5,7-8,a-c,e-16,19-1a,1c-23,26,28-29,2b-2f,31-3d,44-4b,4d-51,60,62-63,68-69,70-72,76-78,7b,81-82,84,87,89,8d-93,95-98,a1,a3,a6,a8-a9,b0-b3,b5-b6,bb-bf,c6-c8,d0,d2-d6,d8,da-e2,ee-f0,f2-fb, D/dalvikvm( 840): Code size stats: 50666/105126 (compiled/total Dalvik), 329108 (native)
-rw-r--r--vm/Android.mk2
-rw-r--r--vm/Globals.h5
-rw-r--r--vm/compiler/Compiler.c6
-rw-r--r--vm/compiler/codegen/arm/CodegenDriver.c18
-rw-r--r--vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NATIVE.S2
-rw-r--r--vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NO_OPT.S2
-rw-r--r--vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER.S2
-rw-r--r--vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER_DEBUG.S2
-rw-r--r--vm/compiler/template/armv5te/TEMPLATE_RETURN.S2
-rw-r--r--vm/compiler/template/armv5te/footer.S2
-rw-r--r--vm/compiler/template/out/CompilerTemplateAsm-armv5te-vfp.S12
-rw-r--r--vm/compiler/template/out/CompilerTemplateAsm-armv5te.S12
-rw-r--r--vm/compiler/template/out/CompilerTemplateAsm-armv7-a.S12
-rw-r--r--vm/interp/Jit.c37
-rw-r--r--vm/mterp/armv5te/footer.S8
-rw-r--r--vm/mterp/out/InterpAsm-armv4t.S8
-rw-r--r--vm/mterp/out/InterpAsm-armv5te-vfp.S8
-rw-r--r--vm/mterp/out/InterpAsm-armv5te.S8
-rw-r--r--vm/mterp/out/InterpAsm-armv7-a.S8
19 files changed, 84 insertions, 72 deletions
diff --git a/vm/Android.mk b/vm/Android.mk
index 04e091077..0138b1737 100644
--- a/vm/Android.mk
+++ b/vm/Android.mk
@@ -58,7 +58,7 @@ ifeq ($(WITH_JIT),true)
# Enable assertions and JIT-tuning
LOCAL_CFLAGS += -UNDEBUG -DDEBUG=1 -DLOG_NDEBUG=1 -DWITH_DALVIK_ASSERT \
- -DWITH_JIT_TUNING -DEXIT_STATS
+ -DWITH_JIT_TUNING -DJIT_STATS
LOCAL_MODULE := libdvm_assert
include $(BUILD_SHARED_LIBRARY)
diff --git a/vm/Globals.h b/vm/Globals.h
index 7bc2d3180..e6997c802 100644
--- a/vm/Globals.h
+++ b/vm/Globals.h
@@ -728,10 +728,11 @@ struct DvmJitGlobals {
int normalExit;
int puntExit;
int translationChains;
- int invokeChain;
- int invokePredictedChain;
+ int invokeMonomorphic;
+ int invokePolymorphic;
int invokeNative;
int returnOp;
+ u8 jitTime;
/* Compiled code cache */
void* codeCache;
diff --git a/vm/compiler/Compiler.c b/vm/compiler/Compiler.c
index de5d4cc6e..13749ac50 100644
--- a/vm/compiler/Compiler.c
+++ b/vm/compiler/Compiler.c
@@ -457,6 +457,9 @@ static void *compilerThreadStart(void *arg)
do {
CompilerWorkOrder work = workDequeue();
dvmUnlockMutex(&gDvmJit.compilerLock);
+#if defined(JIT_STATS)
+ u8 startTime = dvmGetRelativeTimeUsec();
+#endif
/*
* Check whether there is a suspend request on me. This
* is necessary to allow a clean shutdown.
@@ -486,6 +489,9 @@ static void *compilerThreadStart(void *arg)
}
}
free(work.info);
+#if defined(JIT_STATS)
+ gDvmJit.jitTime += dvmGetRelativeTimeUsec() - startTime;
+#endif
dvmLockMutex(&gDvmJit.compilerLock);
} while (workQueueLength() != 0);
}
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c
index 78c52ee21..a49615212 100644
--- a/vm/compiler/codegen/arm/CodegenDriver.c
+++ b/vm/compiler/codegen/arm/CodegenDriver.c
@@ -840,7 +840,7 @@ static ArmLIR *genUnconditionalBranch(CompilationUnit *cUnit, ArmLIR *target)
static void genReturnCommon(CompilationUnit *cUnit, MIR *mir)
{
genDispatchToHandler(cUnit, TEMPLATE_RETURN);
-#if defined(INVOKE_STATS)
+#if defined(JIT_STATS)
gDvmJit.returnOp++;
#endif
int dPC = (int) (cUnit->method->insns + mir->offset);
@@ -1010,13 +1010,13 @@ static void genInvokeSingletonCommon(CompilationUnit *cUnit, MIR *mir,
*/
if (dvmIsNativeMethod(calleeMethod)) {
genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_NATIVE);
-#if defined(INVOKE_STATS)
+#if defined(JIT_STATS)
gDvmJit.invokeNative++;
#endif
} else {
genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_CHAIN);
-#if defined(INVOKE_STATS)
- gDvmJit.invokeChain++;
+#if defined(JIT_STATS)
+ gDvmJit.invokeMonomorphic++;
#endif
/* Branch to the chaining cell */
genUnconditionalBranch(cUnit, &labelList[bb->taken->id]);
@@ -1137,8 +1137,8 @@ static void genInvokeVirtualCommon(CompilationUnit *cUnit, MIR *mir,
* r4PC = callsiteDPC,
*/
genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_NO_OPT);
-#if defined(INVOKE_STATS)
- gDvmJit.invokePredictedChain++;
+#if defined(JIT_STATS)
+ gDvmJit.invokePolymorphic++;
#endif
/* Handle exceptions using the interpreter */
genTrap(cUnit, mir->offset, pcrLabel);
@@ -2829,8 +2829,8 @@ static bool handleFmt35c_3rc(CompilationUnit *cUnit, MIR *mir, BasicBlock *bb,
* r4PC = callsiteDPC,
*/
genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_NO_OPT);
-#if defined(INVOKE_STATS)
- gDvmJit.invokePredictedChain++;
+#if defined(JIT_STATS)
+ gDvmJit.invokePolymorphic++;
#endif
/* Handle exceptions using the interpreter */
genTrap(cUnit, mir->offset, pcrLabel);
@@ -3823,7 +3823,7 @@ gen_fallthrough:
jitToInterpEntries.dvmJitToInterpNoChain), r2);
opRegReg(cUnit, kOpAdd, r1, r1);
opRegRegReg(cUnit, kOpAdd, r4PC, r0, r1);
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
loadConstant(cUnit, r0, kSwitchOverflow);
#endif
opReg(cUnit, kOpBlx, r2);
diff --git a/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NATIVE.S b/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NATIVE.S
index be14a5ced..0dbd6c091 100644
--- a/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NATIVE.S
+++ b/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NATIVE.S
@@ -64,7 +64,7 @@
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
diff --git a/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NO_OPT.S b/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NO_OPT.S
index c08e55690..facce511d 100644
--- a/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NO_OPT.S
+++ b/vm/compiler/template/armv5te/TEMPLATE_INVOKE_METHOD_NO_OPT.S
@@ -48,7 +48,7 @@
str rFP, [r2, #offThread_curFrame] @ self->curFrame = newFp
@ Start executing the callee
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kInlineCacheMiss
#endif
mov pc, r10 @ dvmJitToInterpTraceSelectNoChain
diff --git a/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER.S b/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER.S
index bf073cb76..b1ab44e2f 100644
--- a/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER.S
+++ b/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER.S
@@ -19,7 +19,7 @@
ldr r2, .LdvmJitToInterpNoChain
str r0, [rGLUE, #offGlue_pJitProfTable]
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
bx r2
diff --git a/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER_DEBUG.S b/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER_DEBUG.S
index 31f57c4c2..6acf992d4 100644
--- a/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER_DEBUG.S
+++ b/vm/compiler/template/armv5te/TEMPLATE_MONITOR_ENTER_DEBUG.S
@@ -26,7 +26,7 @@
bx r2
1:
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
ldr pc, .LdvmJitToInterpNoChain
diff --git a/vm/compiler/template/armv5te/TEMPLATE_RETURN.S b/vm/compiler/template/armv5te/TEMPLATE_RETURN.S
index aa9884a89..502c493f1 100644
--- a/vm/compiler/template/armv5te/TEMPLATE_RETURN.S
+++ b/vm/compiler/template/armv5te/TEMPLATE_RETURN.S
@@ -38,7 +38,7 @@
str r9, [r3, #offThread_inJitCodeCache] @ in code cache or not
cmp r9, #0 @ chaining cell exists?
blxne r9 @ jump to the chaining cell
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1 @ callsite is interpreted
diff --git a/vm/compiler/template/armv5te/footer.S b/vm/compiler/template/armv5te/footer.S
index 893749580..8d1c8c211 100644
--- a/vm/compiler/template/armv5te/footer.S
+++ b/vm/compiler/template/armv5te/footer.S
@@ -50,7 +50,7 @@
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
diff --git a/vm/compiler/template/out/CompilerTemplateAsm-armv5te-vfp.S b/vm/compiler/template/out/CompilerTemplateAsm-armv5te-vfp.S
index ac3455a3a..9c1e78846 100644
--- a/vm/compiler/template/out/CompilerTemplateAsm-armv5te-vfp.S
+++ b/vm/compiler/template/out/CompilerTemplateAsm-armv5te-vfp.S
@@ -212,7 +212,7 @@ dvmCompiler_TEMPLATE_RETURN:
str r9, [r3, #offThread_inJitCodeCache] @ in code cache or not
cmp r9, #0 @ chaining cell exists?
blxne r9 @ jump to the chaining cell
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1 @ callsite is interpreted
@@ -278,7 +278,7 @@ dvmCompiler_TEMPLATE_INVOKE_METHOD_NO_OPT:
str rFP, [r2, #offThread_curFrame] @ self->curFrame = newFp
@ Start executing the callee
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kInlineCacheMiss
#endif
mov pc, r10 @ dvmJitToInterpTraceSelectNoChain
@@ -455,7 +455,7 @@ dvmCompiler_TEMPLATE_INVOKE_METHOD_NATIVE:
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
@@ -1393,7 +1393,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER:
ldr r2, .LdvmJitToInterpNoChain
str r0, [rGLUE, #offGlue_pJitProfTable]
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
bx r2
@@ -1432,7 +1432,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER_DEBUG:
bx r2
1:
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
ldr pc, .LdvmJitToInterpNoChain
@@ -1491,7 +1491,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER_DEBUG:
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
diff --git a/vm/compiler/template/out/CompilerTemplateAsm-armv5te.S b/vm/compiler/template/out/CompilerTemplateAsm-armv5te.S
index 4863141e2..e73d9406d 100644
--- a/vm/compiler/template/out/CompilerTemplateAsm-armv5te.S
+++ b/vm/compiler/template/out/CompilerTemplateAsm-armv5te.S
@@ -212,7 +212,7 @@ dvmCompiler_TEMPLATE_RETURN:
str r9, [r3, #offThread_inJitCodeCache] @ in code cache or not
cmp r9, #0 @ chaining cell exists?
blxne r9 @ jump to the chaining cell
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1 @ callsite is interpreted
@@ -278,7 +278,7 @@ dvmCompiler_TEMPLATE_INVOKE_METHOD_NO_OPT:
str rFP, [r2, #offThread_curFrame] @ self->curFrame = newFp
@ Start executing the callee
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kInlineCacheMiss
#endif
mov pc, r10 @ dvmJitToInterpTraceSelectNoChain
@@ -455,7 +455,7 @@ dvmCompiler_TEMPLATE_INVOKE_METHOD_NATIVE:
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
@@ -1121,7 +1121,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER:
ldr r2, .LdvmJitToInterpNoChain
str r0, [rGLUE, #offGlue_pJitProfTable]
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
bx r2
@@ -1160,7 +1160,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER_DEBUG:
bx r2
1:
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
ldr pc, .LdvmJitToInterpNoChain
@@ -1219,7 +1219,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER_DEBUG:
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
diff --git a/vm/compiler/template/out/CompilerTemplateAsm-armv7-a.S b/vm/compiler/template/out/CompilerTemplateAsm-armv7-a.S
index 0b0682604..737ea5ffa 100644
--- a/vm/compiler/template/out/CompilerTemplateAsm-armv7-a.S
+++ b/vm/compiler/template/out/CompilerTemplateAsm-armv7-a.S
@@ -212,7 +212,7 @@ dvmCompiler_TEMPLATE_RETURN:
str r9, [r3, #offThread_inJitCodeCache] @ in code cache or not
cmp r9, #0 @ chaining cell exists?
blxne r9 @ jump to the chaining cell
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1 @ callsite is interpreted
@@ -278,7 +278,7 @@ dvmCompiler_TEMPLATE_INVOKE_METHOD_NO_OPT:
str rFP, [r2, #offThread_curFrame] @ self->curFrame = newFp
@ Start executing the callee
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kInlineCacheMiss
#endif
mov pc, r10 @ dvmJitToInterpTraceSelectNoChain
@@ -455,7 +455,7 @@ dvmCompiler_TEMPLATE_INVOKE_METHOD_NATIVE:
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
@@ -1393,7 +1393,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER:
ldr r2, .LdvmJitToInterpNoChain
str r0, [rGLUE, #offGlue_pJitProfTable]
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
bx r2
@@ -1432,7 +1432,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER_DEBUG:
bx r2
1:
@ Bail to interpreter - no chain [note - r4 still contains rPC]
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kHeavyweightMonitor
#endif
ldr pc, .LdvmJitToInterpNoChain
@@ -1491,7 +1491,7 @@ dvmCompiler_TEMPLATE_MONITOR_ENTER_DEBUG:
@ continue executing the next instruction through the interpreter
ldr r1, .LdvmJitToInterpTraceSelectNoChain @ defined in footer.S
add rPC, r0, #6 @ reconstruct new rPC (advance 6 bytes)
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
mov r0, #kCallsiteInterpreted
#endif
mov pc, r1
diff --git a/vm/interp/Jit.c b/vm/interp/Jit.c
index 3c0082b7e..185182f53 100644
--- a/vm/interp/Jit.c
+++ b/vm/interp/Jit.c
@@ -367,7 +367,7 @@ void dvmJitStopTranslationRequests()
gDvmJit.pProfTable = NULL;
}
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
/* Convenience function to increment counter from assembly code */
void dvmBumpNoChain(int from)
{
@@ -409,11 +409,14 @@ void dvmJitStats()
if (gDvmJit.pJitEntryTable[i].u.info.chain != gDvmJit.jitTableSize)
chains++;
}
+ LOGD("size if %d, entries used is %d",
+ gDvmJit.jitTableSize, gDvmJit.jitTableEntriesUsed);
LOGD(
- "JIT: %d traces, %d slots, %d chains, %d maxQ, %d thresh, %s",
- hit, not_hit + hit, chains, gDvmJit.compilerMaxQueued,
- gDvmJit.threshold, gDvmJit.blockingMode ? "Blocking" : "Non-blocking");
-#if defined(EXIT_STATS)
+ "JIT: %d traces, %d slots, %d chains, %d thresh, %s",
+ hit, not_hit + hit, chains, gDvmJit.threshold,
+ gDvmJit.blockingMode ? "Blocking" : "Non-blocking");
+
+#if defined(JIT_STATS)
LOGD(
"JIT: Lookups: %d hits, %d misses; %d normal, %d punt",
gDvmJit.addrLookupsFound, gDvmJit.addrLookupsNotFound,
@@ -423,15 +426,17 @@ void dvmJitStats()
gDvmJit.noChainExit[kInlineCacheMiss],
gDvmJit.noChainExit[kCallsiteInterpreted],
gDvmJit.noChainExit[kSwitchOverflow]);
+
+ LOGD("JIT: Invoke: %d mono, %d poly, %d native, %d return",
+ gDvmJit.invokeMonomorphic, gDvmJit.invokePolymorphic,
+ gDvmJit.invokeNative, gDvmJit.returnOp);
+ LOGD("JIT: Total compilation time: %llu ms", gDvmJit.jitTime / 1000);
+ LOGD("JIT: Avg unit compilation time: %llu us",
+ gDvmJit.jitTime / gDvmJit.numCompilations);
#endif
+
LOGD("JIT: %d Translation chains, %d interp stubs",
gDvmJit.translationChains, stubs);
-#if defined(INVOKE_STATS)
- LOGD("JIT: Invoke: %d chainable, %d pred. chain, %d native, "
- "%d return",
- gDvmJit.invokeChain, gDvmJit.invokePredictedChain,
- gDvmJit.invokeNative, gDvmJit.returnOp);
-#endif
if (gDvmJit.profile) {
dvmCompilerSortAndPrintTraceProfiles();
}
@@ -818,7 +823,7 @@ void* dvmJitGetCodeAddr(const u2* dPC)
(gDvmJit.pProfTable == NULL);
if (npc == dPC) {
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
gDvmJit.addrLookupsFound++;
#endif
return hideTranslation ?
@@ -828,7 +833,7 @@ void* dvmJitGetCodeAddr(const u2* dPC)
while (gDvmJit.pJitEntryTable[idx].u.info.chain != chainEndMarker) {
idx = gDvmJit.pJitEntryTable[idx].u.info.chain;
if (gDvmJit.pJitEntryTable[idx].dPC == dPC) {
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
gDvmJit.addrLookupsFound++;
#endif
return hideTranslation ?
@@ -837,7 +842,7 @@ void* dvmJitGetCodeAddr(const u2* dPC)
}
}
}
-#if defined(EXIT_STATS)
+#if defined(JIT_STATS)
gDvmJit.addrLookupsNotFound++;
#endif
return NULL;
@@ -914,9 +919,9 @@ bool dvmJitCheckTraceRequest(Thread* self, InterpState* interpState)
if (res || (gDvmJit.compilerQueueLength >= gDvmJit.compilerHighWater)
|| gDvm.debuggerActive || self->suspendCount
#if defined(WITH_PROFILER)
- || gDvm.activeProfilers
+ || gDvm.activeProfilers
#endif
- ) {
+ ) {
if (interpState->jitState != kJitOff) {
interpState->jitState = kJitNormal;
}
diff --git a/vm/mterp/armv5te/footer.S b/vm/mterp/armv5te/footer.S
index ed7797860..e5468ae1f 100644
--- a/vm/mterp/armv5te/footer.S
+++ b/vm/mterp/armv5te/footer.S
@@ -63,7 +63,7 @@ dvmJitToInterpNoChain:
dvmJitToInterpPunt:
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
mov rPC, r0
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
mov r0,lr
bl dvmBumpPunt;
#endif
@@ -104,7 +104,7 @@ dvmJitToInterpSingleStep:
*/
.global dvmJitToInterpTraceSelectNoChain
dvmJitToInterpTraceSelectNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
@@ -170,7 +170,7 @@ dvmJitToInterpNormal:
ldr rPC,[lr, #-1] @ get our target PC
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
add rINST,lr,#-5 @ save start of chain branch
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNormal
#endif
mov r0,rPC
@@ -192,7 +192,7 @@ dvmJitToInterpNormal:
*/
.global dvmJitToInterpNoChain
dvmJitToInterpNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
diff --git a/vm/mterp/out/InterpAsm-armv4t.S b/vm/mterp/out/InterpAsm-armv4t.S
index c9f69cb7a..04cdd727e 100644
--- a/vm/mterp/out/InterpAsm-armv4t.S
+++ b/vm/mterp/out/InterpAsm-armv4t.S
@@ -9596,7 +9596,7 @@ dvmJitToInterpNoChain:
dvmJitToInterpPunt:
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
mov rPC, r0
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
mov r0,lr
bl dvmBumpPunt;
#endif
@@ -9637,7 +9637,7 @@ dvmJitToInterpSingleStep:
*/
.global dvmJitToInterpTraceSelectNoChain
dvmJitToInterpTraceSelectNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
@@ -9703,7 +9703,7 @@ dvmJitToInterpNormal:
ldr rPC,[lr, #-1] @ get our target PC
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
add rINST,lr,#-5 @ save start of chain branch
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNormal
#endif
mov r0,rPC
@@ -9725,7 +9725,7 @@ dvmJitToInterpNormal:
*/
.global dvmJitToInterpNoChain
dvmJitToInterpNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
diff --git a/vm/mterp/out/InterpAsm-armv5te-vfp.S b/vm/mterp/out/InterpAsm-armv5te-vfp.S
index d2f3a79f8..4610acb64 100644
--- a/vm/mterp/out/InterpAsm-armv5te-vfp.S
+++ b/vm/mterp/out/InterpAsm-armv5te-vfp.S
@@ -9114,7 +9114,7 @@ dvmJitToInterpNoChain:
dvmJitToInterpPunt:
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
mov rPC, r0
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
mov r0,lr
bl dvmBumpPunt;
#endif
@@ -9155,7 +9155,7 @@ dvmJitToInterpSingleStep:
*/
.global dvmJitToInterpTraceSelectNoChain
dvmJitToInterpTraceSelectNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
@@ -9221,7 +9221,7 @@ dvmJitToInterpNormal:
ldr rPC,[lr, #-1] @ get our target PC
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
add rINST,lr,#-5 @ save start of chain branch
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNormal
#endif
mov r0,rPC
@@ -9243,7 +9243,7 @@ dvmJitToInterpNormal:
*/
.global dvmJitToInterpNoChain
dvmJitToInterpNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
diff --git a/vm/mterp/out/InterpAsm-armv5te.S b/vm/mterp/out/InterpAsm-armv5te.S
index 919c79d93..a1d86d242 100644
--- a/vm/mterp/out/InterpAsm-armv5te.S
+++ b/vm/mterp/out/InterpAsm-armv5te.S
@@ -9590,7 +9590,7 @@ dvmJitToInterpNoChain:
dvmJitToInterpPunt:
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
mov rPC, r0
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
mov r0,lr
bl dvmBumpPunt;
#endif
@@ -9631,7 +9631,7 @@ dvmJitToInterpSingleStep:
*/
.global dvmJitToInterpTraceSelectNoChain
dvmJitToInterpTraceSelectNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
@@ -9697,7 +9697,7 @@ dvmJitToInterpNormal:
ldr rPC,[lr, #-1] @ get our target PC
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
add rINST,lr,#-5 @ save start of chain branch
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNormal
#endif
mov r0,rPC
@@ -9719,7 +9719,7 @@ dvmJitToInterpNormal:
*/
.global dvmJitToInterpNoChain
dvmJitToInterpNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
diff --git a/vm/mterp/out/InterpAsm-armv7-a.S b/vm/mterp/out/InterpAsm-armv7-a.S
index 62beb430b..7647f2b0b 100644
--- a/vm/mterp/out/InterpAsm-armv7-a.S
+++ b/vm/mterp/out/InterpAsm-armv7-a.S
@@ -9050,7 +9050,7 @@ dvmJitToInterpNoChain:
dvmJitToInterpPunt:
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
mov rPC, r0
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
mov r0,lr
bl dvmBumpPunt;
#endif
@@ -9091,7 +9091,7 @@ dvmJitToInterpSingleStep:
*/
.global dvmJitToInterpTraceSelectNoChain
dvmJitToInterpTraceSelectNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
@@ -9157,7 +9157,7 @@ dvmJitToInterpNormal:
ldr rPC,[lr, #-1] @ get our target PC
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self
add rINST,lr,#-5 @ save start of chain branch
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNormal
#endif
mov r0,rPC
@@ -9179,7 +9179,7 @@ dvmJitToInterpNormal:
*/
.global dvmJitToInterpNoChain
dvmJitToInterpNoChain:
-#ifdef EXIT_STATS
+#ifdef JIT_STATS
bl dvmBumpNoChain
#endif
ldr r10, [rGLUE, #offGlue_self] @ callee saved r10 <- glue->self