diff options
-rw-r--r-- | compiler/optimizing/inliner.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 61d25d3..9b0a697 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -273,10 +273,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; } @@ -284,6 +290,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; } |