diff options
author | 2020-09-09 13:57:17 +0100 | |
---|---|---|
committer | 2020-09-11 13:20:58 +0000 | |
commit | 1fef877c66f066f01653ea98bfefe29304198193 (patch) | |
tree | 65561c8b15844cabe32728b61d1e5d586976acf3 /compiler/optimizing/sharpening.cc | |
parent | a41ea2708d143b5982f1969864513b62706d11d4 (diff) |
Handle more cases of super calls in the compiler.
Add support for calling super methods that are not referenced within the
compiling dex file.
Test: 808-checker-invoke-super
Test: 809-checker-invoke-super-bss
Change-Id: Ib103f818ac8b612a79b6b18cc8eda81131bb3149
Diffstat (limited to 'compiler/optimizing/sharpening.cc')
-rw-r--r-- | compiler/optimizing/sharpening.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc index 04a8eab530..f658f8ad07 100644 --- a/compiler/optimizing/sharpening.cc +++ b/compiler/optimizing/sharpening.cc @@ -58,7 +58,7 @@ static bool BootImageAOTCanEmbedMethod(ArtMethod* method, const CompilerOptions& } HInvokeStaticOrDirect::DispatchInfo HSharpening::SharpenInvokeStaticOrDirect( - ArtMethod* callee, CodeGenerator* codegen) { + ArtMethod* callee, bool has_method_id, CodeGenerator* codegen) { if (kIsDebugBuild) { ScopedObjectAccess soa(Thread::Current()); // Required for GetDeclaringClass below. DCHECK(callee != nullptr); @@ -96,6 +96,8 @@ HInvokeStaticOrDirect::DispatchInfo HSharpening::SharpenInvokeStaticOrDirect( method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kBootImageRelRo; } else if (BootImageAOTCanEmbedMethod(callee, compiler_options)) { method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kBootImageLinkTimePcRelative; + } else if (!has_method_id) { + method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kRuntimeCall; } else { // Use PC-relative access to the .bss methods array. method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kBssEntry; @@ -118,6 +120,9 @@ HInvokeStaticOrDirect::DispatchInfo HSharpening::SharpenInvokeStaticOrDirect( // Use PC-relative access to the .data.bimg.rel.ro methods array. method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kBootImageRelRo; code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallArtMethod; + } else if (!has_method_id) { + method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kRuntimeCall; + code_ptr_location = HInvokeStaticOrDirect::CodePtrLocation::kCallArtMethod; } else { // Use PC-relative access to the .bss methods array. method_load_kind = HInvokeStaticOrDirect::MethodLoadKind::kBssEntry; |