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.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 8a25e82816..45322e7e27 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1343,6 +1343,14 @@ bool HInliner::TryDevirtualize(HInvoke* invoke_instruction,
return false;
}
+ // Don't devirtualize to an intrinsic invalid after the builder phase. The ArtMethod might be an
+ // intrinsic even when the HInvoke isn't e.g. java.lang.CharSequence.isEmpty (not an intrinsic)
+ // can get devirtualized into java.lang.String.isEmpty (which is an intrinsic).
+ if (method->IsIntrinsic() &&
+ !IsValidIntrinsicAfterBuilder(static_cast<Intrinsics>(method->GetIntrinsic()))) {
+ return false;
+ }
+
// Don't bother trying to call directly a default conflict method. It
// doesn't have a proper MethodReference, but also `GetCanonicalMethod`
// will return an actual default implementation.