summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver-inl.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-12-10 16:01:41 -0800
committer android-build-merger <android-build-merger@google.com> 2015-12-10 16:01:41 -0800
commit673fdc77f1242af51e10e7a74975ef57d138b36b (patch)
treec878b89f24f88426291d0b1738e759a6aa0099b6 /compiler/driver/compiler_driver-inl.h
parent898e04bc81777772ed269bc89294c3fb54f7a481 (diff)
parent682857fece0425362c4fb55da611e7144c9ec092 (diff)
Merge "ART: Stash a resolved method late in the verifier" am: 748047de83
am: 682857fece * commit '682857fece0425362c4fb55da611e7144c9ec092': ART: Stash a resolved method late in the verifier
Diffstat (limited to 'compiler/driver/compiler_driver-inl.h')
-rw-r--r--compiler/driver/compiler_driver-inl.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h
index 10841e6700..0eb3e439ac 100644
--- a/compiler/driver/compiler_driver-inl.h
+++ b/compiler/driver/compiler_driver-inl.h
@@ -264,18 +264,16 @@ inline ArtMethod* CompilerDriver::ResolveMethod(
Handle<mirror::ClassLoader> class_loader, const DexCompilationUnit* mUnit,
uint32_t method_idx, InvokeType invoke_type, bool check_incompatible_class_change) {
DCHECK_EQ(class_loader.Get(), soa.Decode<mirror::ClassLoader*>(mUnit->GetClassLoader()));
- ArtMethod* resolved_method = mUnit->GetClassLinker()->ResolveMethod(
- *dex_cache->GetDexFile(), method_idx, dex_cache, class_loader, nullptr, invoke_type);
- DCHECK_EQ(resolved_method == nullptr, soa.Self()->IsExceptionPending());
+ ArtMethod* resolved_method =
+ check_incompatible_class_change
+ ? mUnit->GetClassLinker()->ResolveMethod<ClassLinker::kForceICCECheck>(
+ *dex_cache->GetDexFile(), method_idx, dex_cache, class_loader, nullptr, invoke_type)
+ : mUnit->GetClassLinker()->ResolveMethod<ClassLinker::kNoICCECheckForCache>(
+ *dex_cache->GetDexFile(), method_idx, dex_cache, class_loader, nullptr, invoke_type);
if (UNLIKELY(resolved_method == nullptr)) {
+ DCHECK(soa.Self()->IsExceptionPending());
// Clean up any exception left by type resolution.
soa.Self()->ClearException();
- return nullptr;
- }
- if (check_incompatible_class_change &&
- UNLIKELY(resolved_method->CheckIncompatibleClassChange(invoke_type))) {
- // Silently return null on incompatible class change.
- return nullptr;
}
return resolved_method;
}
@@ -361,7 +359,7 @@ inline int CompilerDriver::IsFastInvoke(
ArtMethod* called_method;
ClassLinker* class_linker = mUnit->GetClassLinker();
if (LIKELY(devirt_target->dex_file == mUnit->GetDexFile())) {
- called_method = class_linker->ResolveMethod(
+ called_method = class_linker->ResolveMethod<ClassLinker::kNoICCECheckForCache>(
*devirt_target->dex_file, devirt_target->dex_method_index, dex_cache, class_loader,
nullptr, kVirtual);
} else {
@@ -369,7 +367,7 @@ inline int CompilerDriver::IsFastInvoke(
auto target_dex_cache(hs.NewHandle(class_linker->RegisterDexFile(
*devirt_target->dex_file,
class_linker->GetOrCreateAllocatorForClassLoader(class_loader.Get()))));
- called_method = class_linker->ResolveMethod(
+ called_method = class_linker->ResolveMethod<ClassLinker::kNoICCECheckForCache>(
*devirt_target->dex_file, devirt_target->dex_method_index, target_dex_cache,
class_loader, nullptr, kVirtual);
}