Add counters to track JIT inline cache hit rate and code cache patch counts.
Also did some WITH_JIT_TUNING cleanup.
Change-Id: I8bb2d681a06b0f2af1f976a007326825a88cea38
diff --git a/vm/interp/Jit.c b/vm/interp/Jit.c
index f475773..e3096df 100644
--- a/vm/interp/Jit.c
+++ b/vm/interp/Jit.c
@@ -404,7 +404,7 @@
gDvmJit.pProfTable = NULL;
}
-#if defined(JIT_STATS)
+#if defined(WITH_JIT_TUNING)
/* Convenience function to increment counter from assembly code */
void dvmBumpNoChain(int from)
{
@@ -452,11 +452,15 @@
hit, not_hit + hit, chains, gDvmJit.threshold,
gDvmJit.blockingMode ? "Blocking" : "Non-blocking");
-#if defined(JIT_STATS)
+#if defined(WITH_JIT_TUNING)
+ LOGD("JIT: Code cache patches: %d", gDvmJit.codeCachePatches);
+
LOGD("JIT: Lookups: %d hits, %d misses; %d normal, %d punt",
gDvmJit.addrLookupsFound, gDvmJit.addrLookupsNotFound,
gDvmJit.normalExit, gDvmJit.puntExit);
+ LOGD("JIT: ICHits: %d", gDvmICHitCount);
+
LOGD("JIT: noChainExit: %d IC miss, %d interp callsite, "
"%d switch overflow",
gDvmJit.noChainExit[kInlineCacheMiss],
@@ -843,7 +847,7 @@
(gDvmJit.pProfTable == NULL);
if (npc == dPC) {
-#if defined(JIT_STATS)
+#if defined(WITH_JIT_TUNING)
gDvmJit.addrLookupsFound++;
#endif
return hideTranslation ?
@@ -853,7 +857,7 @@
while (gDvmJit.pJitEntryTable[idx].u.info.chain != chainEndMarker) {
idx = gDvmJit.pJitEntryTable[idx].u.info.chain;
if (gDvmJit.pJitEntryTable[idx].dPC == dPC) {
-#if defined(JIT_STATS)
+#if defined(WITH_JIT_TUNING)
gDvmJit.addrLookupsFound++;
#endif
return hideTranslation ?
@@ -862,7 +866,7 @@
}
}
}
-#if defined(JIT_STATS)
+#if defined(WITH_JIT_TUNING)
gDvmJit.addrLookupsNotFound++;
#endif
return NULL;