summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver-inl.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-12-10 21:28:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-12-10 21:28:58 +0000
commit170e01a6b59b3242a5afc76c3a03c00ce288150f (patch)
tree4ae775d15f51efb704ca5b00a2ee4b6fb6615812 /compiler/driver/compiler_driver-inl.h
parent34760f9a97e6a1733edfca1b13199f749106a30f (diff)
parentc96205e03bd4f991ad1540df38f9f692ef211b22 (diff)
Merge "Revert "ART: Check invoke-interface earlier in verifier""
Diffstat (limited to 'compiler/driver/compiler_driver-inl.h')
-rw-r--r--compiler/driver/compiler_driver-inl.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h
index 0eb3e439ac..10841e6700 100644
--- a/compiler/driver/compiler_driver-inl.h
+++ b/compiler/driver/compiler_driver-inl.h
@@ -264,16 +264,18 @@ 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 =
- 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);
+ 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());
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;
}
@@ -359,7 +361,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<ClassLinker::kNoICCECheckForCache>(
+ called_method = class_linker->ResolveMethod(
*devirt_target->dex_file, devirt_target->dex_method_index, dex_cache, class_loader,
nullptr, kVirtual);
} else {
@@ -367,7 +369,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<ClassLinker::kNoICCECheckForCache>(
+ called_method = class_linker->ResolveMethod(
*devirt_target->dex_file, devirt_target->dex_method_index, target_dex_cache,
class_loader, nullptr, kVirtual);
}