summaryrefslogtreecommitdiff
path: root/compiler/optimizing/inliner.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/inliner.cc')
-rw-r--r--compiler/optimizing/inliner.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index fd3e787fc8..d7ca17b646 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -541,6 +541,7 @@ bool HInliner::TryInline(HInvoke* invoke_instruction) {
<< " statically resolve the target";
// For baseline compilation, we will collect inline caches, so we should not
// try to inline using them.
+ outermost_graph_->SetUsefulOptimizing();
return false;
}
@@ -1552,9 +1553,7 @@ bool HInliner::IsInliningEncouraged(const HInvoke* invoke_instruction,
return false;
}
- size_t inline_max_code_units = graph_->IsCompilingBaseline()
- ? CompilerOptions::kBaselineInlineMaxCodeUnits
- : codegen_->GetCompilerOptions().GetInlineMaxCodeUnits();
+ size_t inline_max_code_units = codegen_->GetCompilerOptions().GetInlineMaxCodeUnits();
if (accessor.InsnsSizeInCodeUnits() > inline_max_code_units) {
LOG_FAIL(stats_, MethodCompilationStat::kNotInlinedCodeItem)
<< "Method " << method->PrettyMethod()
@@ -1565,6 +1564,14 @@ bool HInliner::IsInliningEncouraged(const HInvoke* invoke_instruction,
return false;
}
+ if (graph_->IsCompilingBaseline() &&
+ accessor.InsnsSizeInCodeUnits() > CompilerOptions::kBaselineInlineMaxCodeUnits) {
+ LOG_FAIL_NO_STAT() << "Reached baseline maximum code unit for inlining "
+ << method->PrettyMethod();
+ outermost_graph_->SetUsefulOptimizing();
+ return false;
+ }
+
if (invoke_instruction->GetBlock()->GetLastInstruction()->IsThrow()) {
LOG_FAIL(stats_, MethodCompilationStat::kNotInlinedEndsWithThrow)
<< "Method " << method->PrettyMethod()
@@ -2129,6 +2136,7 @@ bool HInliner::CanInlineBody(const HGraph* callee_graph,
if (depth_ + 1 > maximum_inlining_depth_for_baseline) {
LOG_FAIL_NO_STAT() << "Reached maximum depth for inlining in baseline compilation: "
<< depth_ << " for " << callee_graph->GetArtMethod()->PrettyMethod();
+ outermost_graph_->SetUsefulOptimizing();
return false;
}
}