summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2020-09-07 12:30:17 +0000
committer Vladimir Marko <vmarko@google.com> 2020-09-07 15:34:58 +0000
commit43d57558bafccff3ec3c5aecb201d7a8a57b2435 (patch)
tree5273085c43f2e7eb074461606778d23fc59590b0 /compiler/optimizing/optimizing_compiler.cc
parentb309240781b17ee994d088648d5fc76814dde436 (diff)
Do not build intrinsic graph for signature polymorphic methods.
The InstructionBuilder cannot build HInvokePolymorphic for an intrinsic graph. It would be rather useless to allow this as signature polymorphic method intrinsics always need the slow-path for unhandled cases, and we would therefore reject the compiled code anyway. Instead, prevent the construction of the intrinsic graph for signature polymorphic methods. Test: testrunner.py --host --optimizing -t 712-varhandle-invocations Bug: 65872996 Change-Id: Id82f1f282383dbd45d6db2bd2a96d838b685d7ed
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 3c168bad65..b7e9d63e2f 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -1050,8 +1050,11 @@ CompiledMethod* OptimizingCompiler::Compile(const dex::CodeItem* code_item,
/*verified_method=*/ nullptr, // Not needed by the Optimizing compiler.
dex_cache,
compiling_class);
+ // All signature polymorphic methods are native.
+ DCHECK(method == nullptr || !method->IsSignaturePolymorphic());
// Go to native so that we don't block GC during compilation.
ScopedThreadSuspension sts(soa.Self(), kNative);
+ // Try to compile a fully intrinsified implementation.
if (method != nullptr && UNLIKELY(method->IsIntrinsic())) {
DCHECK(compiler_options.IsBootImage());
codegen.reset(
@@ -1154,7 +1157,10 @@ CompiledMethod* OptimizingCompiler::JniCompile(uint32_t access_flags,
ScopedObjectAccess soa(Thread::Current());
ArtMethod* method = runtime->GetClassLinker()->LookupResolvedMethod(
method_idx, dex_cache.Get(), /*class_loader=*/ nullptr);
- if (method != nullptr && UNLIKELY(method->IsIntrinsic())) {
+ // Try to compile a fully intrinsified implementation. Do not try to do this for
+ // signature polymorphic methods as the InstructionBuilder cannot handle them;
+ // and it would be useless as they always have a slow path for type conversions.
+ if (method != nullptr && UNLIKELY(method->IsIntrinsic()) && !method->IsSignaturePolymorphic()) {
VariableSizedHandleScope handles(soa.Self());
ScopedNullHandle<mirror::ClassLoader> class_loader; // null means boot class path loader.
Handle<mirror::Class> compiling_class = handles.NewHandle(method->GetDeclaringClass());