Move remaining jobject related functions to use ObjPtr
Also added ObjPtr::DownCast.
Bug: 31113334
Test: test-art-host
Change-Id: I59c253211dc435579ffdfd49f856861ab13d262c
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index d6006b2..f758414 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -1575,10 +1575,10 @@
{
ReaderMutexLock mu(self, *class_linker->DexLock());
for (const ClassLinker::DexCacheData& data : class_linker->GetDexCachesData()) {
- mirror::DexCache* dex_cache =
- down_cast<mirror::DexCache*>(self->DecodeJObject(data.weak_root));
+ ObjPtr<mirror::DexCache> dex_cache =
+ ObjPtr<mirror::DexCache>::DownCast(self->DecodeJObject(data.weak_root));
if (dex_cache != nullptr) {
- dex_caches_.insert(dex_cache);
+ dex_caches_.insert(dex_cache.Ptr());
}
}
}