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-inl.h b/runtime/class_table-inl.h
index d07ad33..d043af3 100644
--- a/runtime/class_table-inl.h
+++ b/runtime/class_table-inl.h
@@ -23,6 +23,7 @@
#include "gc_root-inl.h"
#include "mirror/class.h"
#include "oat_file.h"
+#include "obj_ptr-inl.h"
namespace art {
@@ -93,7 +94,7 @@
}
template<ReadBarrierOption kReadBarrierOption>
-inline mirror::Class* ClassTable::TableSlot::Read() const {
+inline ObjPtr<mirror::Class> ClassTable::TableSlot::Read() const {
const uint32_t before = data_.load(std::memory_order_relaxed);
const ObjPtr<mirror::Class> before_ptr(ExtractPtr(before));
const ObjPtr<mirror::Class> after_ptr(
@@ -103,7 +104,7 @@
// one.
data_.CompareAndSetStrongRelease(before, Encode(after_ptr, MaskHash(before)));
}
- return after_ptr.Ptr();
+ return after_ptr;
}
template<typename Visitor>