Add weight to compiled/interpreter transitions.
Also:
- Cleanup logging.
- Check ArtMethod status before adding compilation requests.
- Don't request osr compilation if we know AddSamples does not come
from a back edge.
Bug: 27865109
Change-Id: I84512f7d957b61ce2458360ed430adb151830278
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 820ae6a..1f3e08b 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -366,7 +366,7 @@
}
last_update_time_ns_.StoreRelease(NanoTime());
VLOG(jit)
- << "JIT added (osr = " << std::boolalpha << osr << std::noboolalpha << ") "
+ << "JIT added (osr=" << std::boolalpha << osr << std::noboolalpha << ") "
<< PrettyMethod(method) << "@" << method
<< " ccache_size=" << PrettySize(CodeCacheSizeLocked()) << ": "
<< " dcache_size=" << PrettySize(DataCacheSizeLocked()) << ": "
@@ -905,15 +905,18 @@
return last_update_time_ns_.LoadAcquire();
}
+bool JitCodeCache::IsOsrCompiled(ArtMethod* method) {
+ MutexLock mu(Thread::Current(), lock_);
+ return osr_code_map_.find(method) != osr_code_map_.end();
+}
+
bool JitCodeCache::NotifyCompilationOf(ArtMethod* method, Thread* self, bool osr) {
if (!osr && ContainsPc(method->GetEntryPointFromQuickCompiledCode())) {
- VLOG(jit) << PrettyMethod(method) << " is already compiled";
return false;
}
MutexLock mu(self, lock_);
if (osr && (osr_code_map_.find(method) != osr_code_map_.end())) {
- VLOG(jit) << PrettyMethod(method) << " is already osr compiled";
return false;
}
@@ -928,7 +931,6 @@
}
if (info->IsMethodBeingCompiled(osr)) {
- VLOG(jit) << PrettyMethod(method) << " is already being compiled";
return false;
}