summaryrefslogtreecommitdiff
path: root/runtime/class_linker-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker-inl.h')
-rw-r--r--runtime/class_linker-inl.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/class_linker-inl.h b/runtime/class_linker-inl.h
index b79f3f5685..8f3692dd39 100644
--- a/runtime/class_linker-inl.h
+++ b/runtime/class_linker-inl.h
@@ -476,6 +476,11 @@ inline ArtMethod* ClassLinker::ResolveMethod(uint32_t method_idx,
DCHECK(Thread::Current()->IsExceptionPending());
return nullptr;
}
+ // Look for the method again in case the type resolution updated the cache.
+ resolved = dex_cache->GetResolvedMethod(method_idx);
+ if (kResolveMode == ResolveMode::kNoChecks && resolved != nullptr) {
+ return resolved;
+ }
}
// Check if the invoke type matches the class type.
@@ -584,6 +589,12 @@ inline ArtField* ClassLinker::ResolveField(uint32_t field_idx,
return nullptr;
}
+ // Look for the field again in case the type resolution updated the cache.
+ resolved = dex_cache->GetResolvedField(field_idx);
+ if (resolved != nullptr) {
+ return resolved;
+ }
+
resolved = FindResolvedField(klass, dex_cache.Get(), class_loader.Get(), field_idx, is_static);
if (resolved == nullptr) {
const char* name = dex_file.GetFieldName(field_id);