ObjPtr<>-ify ClassTable.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: Ieced7a452d381e5cacbafc91fd5d7672d9d92c30
diff --git a/runtime/class_table.cc b/runtime/class_table.cc
index 58f3674..b7d37e2 100644
--- a/runtime/class_table.cc
+++ b/runtime/class_table.cc
@@ -37,7 +37,7 @@
return LookupByDescriptor(klass) == klass;
}
-mirror::Class* ClassTable::LookupByDescriptor(ObjPtr<mirror::Class> klass) {
+ObjPtr<mirror::Class> ClassTable::LookupByDescriptor(ObjPtr<mirror::Class> klass) {
ReaderMutexLock mu(Thread::Current(), lock_);
TableSlot slot(klass);
for (ClassSet& class_set : classes_) {
@@ -49,7 +49,9 @@
return nullptr;
}
-mirror::Class* ClassTable::UpdateClass(const char* descriptor, mirror::Class* klass, size_t hash) {
+ObjPtr<mirror::Class> ClassTable::UpdateClass(const char* descriptor,
+ ObjPtr<mirror::Class> klass,
+ size_t hash) {
WriterMutexLock mu(Thread::Current(), lock_);
// Should only be updating latest table.
DescriptorHashPair pair(descriptor, hash);
@@ -62,7 +64,7 @@
}
LOG(FATAL) << "Updating class not found " << descriptor;
}
- mirror::Class* const existing = existing_it->Read();
+ const ObjPtr<mirror::Class> existing = existing_it->Read();
CHECK_NE(existing, klass) << descriptor;
CHECK(!existing->IsResolved()) << descriptor;
CHECK_EQ(klass->GetStatus(), ClassStatus::kResolving) << descriptor;
@@ -113,7 +115,7 @@
return classes_.back().size();
}
-mirror::Class* ClassTable::Lookup(const char* descriptor, size_t hash) {
+ObjPtr<mirror::Class> ClassTable::Lookup(const char* descriptor, size_t hash) {
DescriptorHashPair pair(descriptor, hash);
ReaderMutexLock mu(Thread::Current(), lock_);
for (ClassSet& class_set : classes_) {