summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2024-06-09 14:15:44 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2024-06-12 10:32:47 +0000
commit05e428dacb0b4877960e3b1c0d50cb9c90f378d5 (patch)
treeedfbfa71030668e7f40051c1fbdb276930c675bd /compiler/optimizing/optimizing_compiler.cc
parent9d87c7611861d7dfddde1f68d2a91d0b086d6f4d (diff)
Reland "Rewrite how we identify hot methods."
This reverts commit e5d59342bcfdb7f6d2e7d7b4a4ce8dd97ca39091. With this CL, startup methods which do not reach the JIT threshold will just be marked as startup. The compiler driver now decides whether they should be compiled. Reason for revert: Move the decision of compiling startup methods in the compiler driver. Change-Id: Iba8ac7f092e1ce0f412a579a93da57e82fdea4a6
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 45d534a9ec..3f73459a00 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -30,6 +30,7 @@
#include "base/macros.h"
#include "base/mutex.h"
#include "base/scoped_arena_allocator.h"
+#include "base/systrace.h"
#include "base/timing_logger.h"
#include "builder.h"
#include "code_generator.h"
@@ -781,6 +782,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
}
if (Compiler::IsPathologicalCase(*code_item, method_idx, dex_file)) {
+ SCOPED_TRACE << "Not compiling because of pathological case";
MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kNotCompiledPathological);
return nullptr;
}
@@ -791,6 +793,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
if ((compiler_options.GetCompilerFilter() == CompilerFilter::kSpace)
&& (CodeItemInstructionAccessor(dex_file, code_item).InsnsSizeInCodeUnits() >
kSpaceFilterOptimizingThreshold)) {
+ SCOPED_TRACE << "Not compiling because of space filter";
MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kNotCompiledSpaceFilter);
return nullptr;
}
@@ -865,6 +868,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
compilation_stats_.get());
GraphAnalysisResult result = builder.BuildGraph();
if (result != kAnalysisSuccess) {
+ SCOPED_TRACE << "Not compiling because of " << result;
switch (result) {
case kAnalysisSkipped: {
MaybeRecordStat(compilation_stats_.get(),
@@ -927,6 +931,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
// However, we may have run out of memory trying to create it, so in this
// case just abort the compilation.
if (graph->GetProfilingInfo() == nullptr) {
+ SCOPED_TRACE << "Not compiling because of out of memory";
MaybeRecordStat(compilation_stats_.get(), MethodCompilationStat::kJitOutOfMemoryForCommit);
return nullptr;
}
@@ -938,6 +943,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator,
compilation_stats_.get());
if (UNLIKELY(codegen->GetFrameSize() > codegen->GetMaximumFrameSize())) {
+ SCOPED_TRACE << "Not compiling because of stack frame too large";
LOG(WARNING) << "Stack frame size is " << codegen->GetFrameSize()
<< " which is larger than the maximum of " << codegen->GetMaximumFrameSize()
<< " bytes. Method: " << graph->PrettyMethod();