diff options
author | 2019-04-10 16:14:56 +0100 | |
---|---|---|
committer | 2019-05-08 08:19:28 +0000 | |
commit | 1fe5839d10114209a75d1716bd81c353e4096810 (patch) | |
tree | 1c4453056b53a1c9f362c697148a6f809690bb71 /runtime/class_table.cc | |
parent | c6934e36d33ab402b7b51c78d46c319fc33e8ef3 (diff) |
ObjPtr<>-ify ClassTable.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 31113334
Change-Id: Ieced7a452d381e5cacbafc91fd5d7672d9d92c30
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_) { |