diff options
author | 2017-07-20 14:09:32 +0000 | |
---|---|---|
committer | 2017-07-20 14:09:32 +0000 | |
commit | 331f4c4e287791611733120c1a1c2afd55ecdd65 (patch) | |
tree | 1fcf7810c6c8e2df8b6191bb14a69084f3c7cf11 /compiler/driver/compiler_driver.cc | |
parent | 13c8343a3394414c90f2fcd1e8efff70e7d2387e (diff) | |
parent | ba118827465d12177f3996e50133960087b1c916 (diff) |
Merge "ART: Change method lookup to be more consistent to JLS and the RI."
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index f3718c467b..cf04e41d5c 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -373,14 +373,12 @@ static void SetupIntrinsic(Thread* self, REQUIRES_SHARED(Locks::mutator_lock_) { ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); PointerSize image_size = class_linker->GetImagePointerSize(); - mirror::Class* cls = class_linker->FindSystemClass(self, class_name); + ObjPtr<mirror::Class> cls = class_linker->FindSystemClass(self, class_name); if (cls == nullptr) { LOG(FATAL) << "Could not find class of intrinsic " << class_name; } - ArtMethod* method = (invoke_type == kStatic || invoke_type == kDirect) - ? cls->FindDeclaredDirectMethod(method_name, signature, image_size) - : cls->FindDeclaredVirtualMethod(method_name, signature, image_size); - if (method == nullptr) { + ArtMethod* method = cls->FindClassMethod(method_name, signature, image_size); + if (method == nullptr || method->GetDeclaringClass() != cls) { LOG(FATAL) << "Could not find method of intrinsic " << class_name << " " << method_name << " " << signature; } @@ -543,7 +541,7 @@ static void CompileMethod(Thread* self, // TODO: Lookup annotation from DexFile directly without resolving method. ArtMethod* method = - Runtime::Current()->GetClassLinker()->ResolveMethod<ClassLinker::kNoICCECheckForCache>( + Runtime::Current()->GetClassLinker()->ResolveMethod<ClassLinker::ResolveMode::kNoChecks>( dex_file, method_idx, dex_cache, @@ -1755,7 +1753,7 @@ class ResolveClassFieldsAndMethodsVisitor : public CompilationVisitor { } if (resolve_fields_and_methods) { while (it.HasNextDirectMethod()) { - ArtMethod* method = class_linker->ResolveMethod<ClassLinker::kNoICCECheckForCache>( + ArtMethod* method = class_linker->ResolveMethod<ClassLinker::ResolveMode::kNoChecks>( dex_file, it.GetMemberIndex(), dex_cache, class_loader, nullptr, it.GetMethodInvokeType(class_def)); if (method == nullptr) { @@ -1764,7 +1762,7 @@ class ResolveClassFieldsAndMethodsVisitor : public CompilationVisitor { it.Next(); } while (it.HasNextVirtualMethod()) { - ArtMethod* method = class_linker->ResolveMethod<ClassLinker::kNoICCECheckForCache>( + ArtMethod* method = class_linker->ResolveMethod<ClassLinker::ResolveMode::kNoChecks>( dex_file, it.GetMemberIndex(), dex_cache, class_loader, nullptr, it.GetMethodInvokeType(class_def)); if (method == nullptr) { |