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.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 8b10a78212..3800c96937 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -124,13 +124,18 @@ void HInliner::UpdateInliningBudget() {
}
}
-void HInliner::Run() {
- if (graph_->IsDebuggable()) {
+bool HInliner::Run() {
+ if (compiler_driver_->GetCompilerOptions().GetInlineMaxCodeUnits() == 0) {
+ // Inlining effectively disabled.
+ return false;
+ } else if (graph_->IsDebuggable()) {
// For simplicity, we currently never inline when the graph is debuggable. This avoids
// doing some logic in the runtime to discover if a method could have been inlined.
- return;
+ return false;
}
+ bool didInline = false;
+
// Initialize the number of instructions for the method being compiled. Recursive calls
// to HInliner::Run have already updated the instruction count.
if (outermost_graph_ == graph_) {
@@ -171,7 +176,9 @@ void HInliner::Run() {
call->GetDexMethodIndex(), /* with_signature */ false);
// Tests prevent inlining by having $noinline$ in their method names.
if (callee_name.find("$noinline$") == std::string::npos) {
- if (!TryInline(call) && honor_inline_directives) {
+ if (TryInline(call)) {
+ didInline = true;
+ } else {
bool should_have_inlined = (callee_name.find("$inline$") != std::string::npos);
CHECK(!should_have_inlined) << "Could not inline " << callee_name;
}
@@ -179,12 +186,16 @@ void HInliner::Run() {
} else {
DCHECK(!honor_inline_directives);
// Normal case: try to inline.
- TryInline(call);
+ if (TryInline(call)) {
+ didInline = true;
+ }
}
}
instruction = next;
}
}
+
+ return didInline;
}
static bool IsMethodOrDeclaringClassFinal(ArtMethod* method)