summaryrefslogtreecommitdiff
path: root/runtime/jit/jit_code_cache.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-11-27 17:42:32 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2019-12-03 14:32:09 +0000
commita59af8aeaad8fe7d68d8f8de63eab9cf85b6ab31 (patch)
tree83195c74b135731cc4555254763a8f449691c1b0 /runtime/jit/jit_code_cache.cc
parent5c8cc64b5f1580faf510f27527e7e22987174963 (diff)
JIT baseline: trigger optimized compilation on hotness threshold.
- Add a new hotness count in the ProfilingInfo to not conflict with interpreter hotness which may use it for OSR. - Add a baseline flag in the OatQuickMethodHeader to identify baseline compiled methods. - Add a -Xusetieredjit flag to experiment and test. Bug: 119800099 Test: test.py with Xusetieredjit to true Change-Id: I8512853f869f1312e3edc60bf64413dee9143c52
Diffstat (limited to 'runtime/jit/jit_code_cache.cc')
-rw-r--r--runtime/jit/jit_code_cache.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index c02a699eed..519655d843 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -1581,9 +1581,19 @@ bool JitCodeCache::NotifyCompilationOf(ArtMethod* method,
Thread* self,
bool osr,
bool prejit,
+ bool baseline,
JitMemoryRegion* region) {
- if (!osr && ContainsPc(method->GetEntryPointFromQuickCompiledCode())) {
- return false;
+ const void* existing_entry_point = method->GetEntryPointFromQuickCompiledCode();
+ if (!osr && ContainsPc(existing_entry_point)) {
+ OatQuickMethodHeader* method_header =
+ OatQuickMethodHeader::FromEntryPoint(existing_entry_point);
+ if (CodeInfo::IsBaseline(method_header->GetOptimizedCodeInfoPtr()) == baseline) {
+ VLOG(jit) << "Not compiling "
+ << method->PrettyMethod()
+ << " because it has already been compiled"
+ << " baseline=" << std::boolalpha << baseline;
+ return false;
+ }
}
if (NeedsClinitCheckBeforeCall(method) && !prejit) {