summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/entrypoint_utils-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils-inl.h')
-rw-r--r--runtime/entrypoints/entrypoint_utils-inl.h34
1 files changed, 11 insertions, 23 deletions
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h
index 5b931a15be..84299d5077 100644
--- a/runtime/entrypoints/entrypoint_utils-inl.h
+++ b/runtime/entrypoints/entrypoint_utils-inl.h
@@ -80,20 +80,10 @@ inline ArtMethod* GetResolvedMethod(ArtMethod* outer_method,
for (InlineInfo inline_info : inline_infos) {
DCHECK(!inline_info.EncodesArtMethod());
DCHECK_NE(inline_info.GetDexPc(), static_cast<uint32_t>(-1));
- MethodInfo method_info = code_info.GetMethodInfoOf(inline_info);
- uint32_t method_index = method_info.GetMethodIndex();
- ArtMethod* inlined_method;
- if (method_info.HasDexFileIndex()) {
- const DexFile* dex_file = class_linker->GetBootClassPath()[method_info.GetDexFileIndex()];
- ObjPtr<mirror::DexCache> dex_cache = class_linker->FindDexCache(Thread::Current(), *dex_file);
- // The class loader is always nullptr for this case so we can simplify the call.
- DCHECK_EQ(dex_cache->GetClassLoader(), nullptr);
- inlined_method = class_linker->LookupResolvedMethod(method_index, dex_cache, nullptr);
- } else {
- inlined_method = class_linker->LookupResolvedMethod(
- method_index, outer_method->GetDexCache(), outer_method->GetClassLoader());
- }
-
+ uint32_t method_index = code_info.GetMethodIndexOf(inline_info);
+ ArtMethod* inlined_method = class_linker->LookupResolvedMethod(method_index,
+ method->GetDexCache(),
+ method->GetClassLoader());
if (UNLIKELY(inlined_method == nullptr)) {
LOG(FATAL) << "Could not find an inlined method from an .oat file: "
<< method->GetDexFile()->PrettyMethod(method_index) << " . "
@@ -101,8 +91,7 @@ inline ArtMethod* GetResolvedMethod(ArtMethod* outer_method,
UNREACHABLE();
}
DCHECK(!inlined_method->IsRuntimeMethod());
- if (UNLIKELY(inlined_method->GetDexFile() != method->GetDexFile() &&
- !method_info.HasDexFileIndex())) {
+ if (UNLIKELY(inlined_method->GetDexFile() != method->GetDexFile())) {
// TODO: We could permit inlining within a multi-dex oat file and the boot image,
// even going back from boot image methods to the same oat file. However, this is
// not currently implemented in the compiler. Therefore crossing dex file boundary
@@ -110,14 +99,13 @@ inline ArtMethod* GetResolvedMethod(ArtMethod* outer_method,
bool target_sdk_at_least_p =
IsSdkVersionSetAndAtLeast(Runtime::Current()->GetTargetSdkVersion(), SdkVersion::kP);
LOG(target_sdk_at_least_p ? FATAL : WARNING)
- << "Inlined method resolution crossed dex file boundary: from " << method->PrettyMethod()
+ << "Inlined method resolution crossed dex file boundary: from "
+ << method->PrettyMethod()
<< " in " << method->GetDexFile()->GetLocation() << "/"
- << static_cast<const void*>(method->GetDexFile()) << " to "
- << inlined_method->PrettyMethod() << " in " << inlined_method->GetDexFile()->GetLocation()
- << "/" << static_cast<const void*>(inlined_method->GetDexFile()) << ". "
- << "The outermost method in the chain is: " << outer_method->PrettyMethod() << " in "
- << outer_method->GetDexFile()->GetLocation() << "/"
- << static_cast<const void*>(outer_method->GetDexFile())
+ << static_cast<const void*>(method->GetDexFile())
+ << " to " << inlined_method->PrettyMethod()
+ << " in " << inlined_method->GetDexFile()->GetLocation() << "/"
+ << static_cast<const void*>(inlined_method->GetDexFile()) << ". "
<< "This must be due to duplicate classes or playing wrongly with class loaders. "
<< "The runtime is in an unsafe state.";
}