ART: Clean up obj_ptr.h and obj_ptr-inl.h .
Move ObjPtr<> member function definitions that depend on
other functions in obj_ptr-inl.h also to the obj_ptr-inl.h.
Use C++14 std::enable_if_t<> and C++17 std::is_base_of_v<>.
Improve kObjPtrPoisoningValidateOnCopy code readability
(avoid ternary operator). Move relational opeators to
namespace scope and reimplement != as negation of ==.
Also move PtrCompression<>::Compress(ObjPtr<>) to the
object_reference-inl.h which includes obj_ptr-inl.h.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Change-Id: I5116c0e322775c19a88687f30742ef654a8be873
diff --git a/runtime/mirror/object_reference.h b/runtime/mirror/object_reference.h
index e19e165..f01bcbd 100644
--- a/runtime/mirror/object_reference.h
+++ b/runtime/mirror/object_reference.h
@@ -48,9 +48,7 @@
}
// Convert an ObjPtr to a compressed reference.
- static uint32_t Compress(ObjPtr<MirrorType> ptr) REQUIRES_SHARED(Locks::mutator_lock_) {
- return Compress(ptr.Ptr());
- }
+ static uint32_t Compress(ObjPtr<MirrorType> ptr) REQUIRES_SHARED(Locks::mutator_lock_);
};
// Value type representing a reference to a mirror::Object of type MirrorType.