Move ArtField to ObjPtr
Added EXPECT_OBJ_PTR_EQ and variants to gtests.
Fixed moving GC bugs in:
ClassLinker::CreatePathClassLoader
ClassLinkerTest: StaticFields
ObjPtr Decode call sites: 186 -> 181.
Some tests fail due to ResolvedFieldAccessTest, will fix in follow
up CL.
Bug: 31113334
Test: test-art-host CC baker
Change-Id: I8b266ad00f3c20c8cbe7cfdf280d175083df0b88
diff --git a/runtime/gc_root.h b/runtime/gc_root.h
index 0a98f55..85cd0a4 100644
--- a/runtime/gc_root.h
+++ b/runtime/gc_root.h
@@ -24,6 +24,7 @@
namespace art {
class ArtField;
class ArtMethod;
+template<class MirrorType, bool kPoison> class ObjPtr;
namespace mirror {
class Object;
@@ -196,7 +197,10 @@
}
ALWAYS_INLINE GcRoot() {}
- explicit ALWAYS_INLINE GcRoot(MirrorType* ref) REQUIRES_SHARED(Locks::mutator_lock_);
+ explicit ALWAYS_INLINE GcRoot(MirrorType* ref)
+ REQUIRES_SHARED(Locks::mutator_lock_);
+ explicit ALWAYS_INLINE GcRoot(ObjPtr<MirrorType, kIsDebugBuild> ref)
+ REQUIRES_SHARED(Locks::mutator_lock_);
private:
// Root visitors take pointers to root_ and place them in CompressedReference** arrays. We use a