summaryrefslogtreecommitdiff
path: root/compiler/optimizing/inliner.cc
diff options
context:
space:
mode:
author Brian Carlstrom <bdc@google.com> 2015-09-28 17:47:53 -0700
committer Narayan Kamath <narayan@google.com> 2015-11-12 11:52:47 +0000
commit925ef34f956cfbc6dfe78cd7d0b82e64d17c261f (patch)
tree48e803014a7ab9d8da35f340f4b21557170beb06 /compiler/optimizing/inliner.cc
parentb7802898318f9b7d7e12ac24a225727d9e5909c2 (diff)
Revert "Fix another source of undeterministic inlining." DO NOT MERGE
This reverts commit bd7eef17de5f3d25f411702f9f260a96455b4cf7. Bug: 24467386 Bug: 20037935 (cherry picked from commit 39becb96f0c2ba1823ca0cf046e9f12344f9f3bd) Change-Id: I3ebdc669dc3085570bb534dce710712bf3ed25e2
Diffstat (limited to 'compiler/optimizing/inliner.cc')
-rw-r--r--compiler/optimizing/inliner.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 8490730535..ea97c51c9e 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -253,10 +253,16 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,
continue;
}
+ // We only do this on the target. We still want deterministic inlining on the host.
+ constexpr bool kInliningMustBeDeterministic = !kIsTargetBuild;
+
if (current->CanThrow()) {
VLOG(compiler) << "Method " << PrettyMethod(method_index, caller_dex_file)
<< " could not be inlined because " << current->DebugName()
<< " can throw";
+ if (!kInliningMustBeDeterministic) {
+ resolved_method->SetShouldNotInline();
+ }
return false;
}
@@ -264,6 +270,9 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,
VLOG(compiler) << "Method " << PrettyMethod(method_index, caller_dex_file)
<< " could not be inlined because " << current->DebugName()
<< " needs an environment";
+ if (!kInliningMustBeDeterministic) {
+ resolved_method->SetShouldNotInline();
+ }
return false;
}