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
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index a40218d..ac71ce9 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -621,9 +621,7 @@
ArtMethod* caller = graph_->GetArtMethod();
// Under JIT, we should always know the caller.
DCHECK(caller != nullptr);
- ScopedProfilingInfoUse spiu(Runtime::Current()->GetJit(), caller, Thread::Current());
- ProfilingInfo* profiling_info = spiu.GetProfilingInfo();
-
+ ProfilingInfo* profiling_info = graph_->GetProfilingInfo();
if (profiling_info == nullptr) {
return kInlineCacheNoData;
}
@@ -1995,6 +1993,11 @@
/* start_instruction_id= */ caller_instruction_counter);
callee_graph->SetArtMethod(resolved_method);
+ ScopedProfilingInfoUse spiu(Runtime::Current()->GetJit(), resolved_method, Thread::Current());
+ if (Runtime::Current()->GetJit() != nullptr) {
+ callee_graph->SetProfilingInfo(spiu.GetProfilingInfo());
+ }
+
// When they are needed, allocate `inline_stats_` on the Arena instead
// of on the stack, as Clang might produce a stack frame too large
// for this function, that would not fit the requirements of the