Move mirror::Class to use ObjPtr
Leave the return types as non ObjPtr for now. Fixed moving GC bugs
in tests.
Test: test-art-host
Bug: 31113334
Change-Id: I5da1b5ac55dfbc5cc97a64be2c870ba9f512d9b0
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h
index e37db7d..8077c21 100644
--- a/runtime/entrypoints/entrypoint_utils-inl.h
+++ b/runtime/entrypoints/entrypoint_utils-inl.h
@@ -231,10 +231,10 @@
// CheckObjectAlloc can cause thread suspension which means we may now be instrumented.
return klass->Alloc</*kInstrumented*/true>(
self,
- Runtime::Current()->GetHeap()->GetCurrentAllocator());
+ Runtime::Current()->GetHeap()->GetCurrentAllocator()).Ptr();
}
DCHECK(klass != nullptr);
- return klass->Alloc<kInstrumented>(self, allocator_type);
+ return klass->Alloc<kInstrumented>(self, allocator_type).Ptr();
}
// Given the context of a calling Method and a resolved class, create an instance.
@@ -254,10 +254,10 @@
// Pass in false since the object cannot be finalizable.
// CheckClassInitializedForObjectAlloc can cause thread suspension which means we may now be
// instrumented.
- return klass->Alloc</*kInstrumented*/true, false>(self, heap->GetCurrentAllocator());
+ return klass->Alloc</*kInstrumented*/true, false>(self, heap->GetCurrentAllocator()).Ptr();
}
// Pass in false since the object cannot be finalizable.
- return klass->Alloc<kInstrumented, false>(self, allocator_type);
+ return klass->Alloc<kInstrumented, false>(self, allocator_type).Ptr();
}
// Given the context of a calling Method and an initialized class, create an instance.
@@ -268,7 +268,7 @@
gc::AllocatorType allocator_type) {
DCHECK(klass != nullptr);
// Pass in false since the object cannot be finalizable.
- return klass->Alloc<kInstrumented, false>(self, allocator_type);
+ return klass->Alloc<kInstrumented, false>(self, allocator_type).Ptr();
}