summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2021-11-19 14:53:07 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2021-11-29 11:22:25 +0000
commit9e598907f28277b0f0e3dcd725d6ed9d71f8a958 (patch)
tree82a585f67b83fe937a47bf29b8c0397c18c10f60 /compiler/optimizing/optimizing_compiler.cc
parentac4e4a231f6438974f6d8adcfe91308e9d137ed4 (diff)
Simplify hotness count in baseline compiled code.
- Always require the current ArtMethod, which also removes the need to handle empty frames. - Remove the use of some temporary registers. - Require a profiling info when compiling baseline. - Add a slow path for requiring an optimized compilation. - Make the counter decrement instead of increment. A next CL will make the hotness configurable through --jittreshold. Test: test.py Bug: 146423102 Change-Id: I1485f66401d6ed218456fe2849eb05fa77479668
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index c4dd31dca1..10b59d2277 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -812,6 +812,14 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
graph->SetArtMethod(method);
}
+ jit::Jit* jit = Runtime::Current()->GetJit();
+ if (jit != nullptr) {
+ ProfilingInfo* info = jit->GetCodeCache()->GetProfilingInfo(method, Thread::Current());
+ DCHECK(compilation_kind != CompilationKind::kBaseline || info != nullptr)
+ << "Compiling a method baseline should always have a ProfilingInfo";
+ graph->SetProfilingInfo(info);
+ }
+
std::unique_ptr<CodeGenerator> codegen(
CodeGenerator::Create(graph,
compiler_options,