diff options
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r-- | runtime/class_table.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc index 58f3674804..b7d37e2e37 100644 --- a/runtime/class_table.cc +++ b/runtime/class_table.cc @@ -37,7 +37,7 @@ bool ClassTable::Contains(ObjPtr<mirror::Class> klass) { 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 @@ mirror::Class* ClassTable::LookupByDescriptor(ObjPtr<mirror::Class> klass) { 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 @@ mirror::Class* ClassTable::UpdateClass(const char* descriptor, mirror::Class* kl } 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 @@ size_t ClassTable::NumReferencedNonZygoteClasses() const { 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_) { |