summaryrefslogtreecommitdiffstats
path: root/vm/compiler
diff options
context:
space:
mode:
authorBen Cheng <bccheng@android.com>2010-03-05 15:37:30 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-03-05 15:37:30 -0800
commitf8069e844054d29f320a9ece29fc638a884bbf69 (patch)
tree0ed41d30532c8a4b053edcea2e8c950851d3c58c /vm/compiler
parent1a29c735752f4082c8e32347f4a6b10c4fdeb1f5 (diff)
parent86717f79d9b018f4d69cc991075fa36611f234e5 (diff)
downloadandroid_dalvik-f8069e844054d29f320a9ece29fc638a884bbf69.tar.gz
android_dalvik-f8069e844054d29f320a9ece29fc638a884bbf69.tar.bz2
android_dalvik-f8069e844054d29f320a9ece29fc638a884bbf69.zip
Merge "Collect more JIT stats in the assert build."
Diffstat (limited to 'vm/compiler')
-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
11 files changed, 39 insertions, 33 deletions
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