Use ObjPtr for ResolvedFieldAccessTest and ResolvedMethodAccessTest

Also added LookupResolvedType that is guaranteed to not do thread
suspension but deals with multidex since GetResolvedType will
return null if the type was resolved in another dex file.

Added test.

Bug: 31113334

Test: test-art-host CC baker

Change-Id: I50493bca7d8ce9760546c3116b717484c62c47a4
diff --git a/runtime/class_linker.h b/runtime/class_linker.h
index df7fb61..f69a576 100644
--- a/runtime/class_linker.h
+++ b/runtime/class_linker.h
@@ -278,6 +278,14 @@
       REQUIRES_SHARED(Locks::mutator_lock_)
       REQUIRES(!dex_lock_, !Roles::uninterruptible_);
 
+  // Look up a resolved type with the given ID from the DexFile. The ClassLoader is used to search
+  // for the type, since it may be referenced from but not contained within the given DexFile.
+  ObjPtr<mirror::Class> LookupResolvedType(const DexFile& dex_file,
+                                           uint16_t type_idx,
+                                           ObjPtr<mirror::DexCache> dex_cache,
+                                           ObjPtr<mirror::ClassLoader> class_loader)
+      REQUIRES_SHARED(Locks::mutator_lock_);
+
   // Resolve a type with the given ID from the DexFile, storing the
   // result in DexCache. The ClassLoader is used to search for the
   // type, since it may be referenced from but not contained within