From 24b3d648ff6c2c200003f55ac63fc910d7bfd40f Mon Sep 17 00:00:00 2001 From: Sam Saccone Date: Sun, 29 Jan 2023 18:16:24 +0000 Subject: Revert "Write classes in runtime-generated app image." This reverts commit df68c0a6f0d36728fa728049e5bcec20de2d0d5e. Reason for revert: b/267084527 Change-Id: I2eacf89c23db00c46d56e78009efa11bed31af60 --- runtime/mirror/array-inl.h | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'runtime/mirror/array-inl.h') diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h index 2bdf8277cd..a7faa376cd 100644 --- a/runtime/mirror/array-inl.h +++ b/runtime/mirror/array-inl.h @@ -240,16 +240,13 @@ inline T PointerArray::GetElementPtrSizeUnchecked(uint32_t idx) { // C style casts here since we sometimes have T be a pointer, or sometimes an integer // (for stack traces). using ConversionType = typename std::conditional_t, uintptr_t, T>; - // Note: we cast the array directly when unchecked as this code gets called by - // runtime_image, which can pass a 64bit pointer and therefore cannot be held - // by an ObjPtr. if (kPointerSize == PointerSize::k64) { uint64_t value = - static_cast(reinterpret_cast(this)->GetWithoutChecks(idx)); + static_cast(AsLongArrayUnchecked()->GetWithoutChecks(idx)); return (T) dchecked_integral_cast(value); } else { uint32_t value = - static_cast(reinterpret_cast(this)->GetWithoutChecks(idx)); + static_cast(AsIntArrayUnchecked()->GetWithoutChecks(idx)); return (T) dchecked_integral_cast(value); } } @@ -264,15 +261,12 @@ inline T PointerArray::GetElementPtrSize(uint32_t idx, PointerSize ptr_size) { template inline void PointerArray::SetElementPtrSize(uint32_t idx, uint64_t element, PointerSize ptr_size) { - // Note: we cast the array directly when unchecked as this code gets called by - // runtime_image, which can pass a 64bit pointer and therefore cannot be held - // by an ObjPtr. if (ptr_size == PointerSize::k64) { - (kUnchecked ? reinterpret_cast(this) : AsLongArray().Ptr())-> + (kUnchecked ? ObjPtr::DownCast(ObjPtr(this)) : AsLongArray())-> SetWithoutChecks(idx, element); } else { uint32_t element32 = dchecked_integral_cast(element); - (kUnchecked ? reinterpret_cast(this) : AsIntArray().Ptr()) + (kUnchecked ? ObjPtr::DownCast(ObjPtr(this)) : AsIntArray()) ->SetWithoutChecks(idx, element32); } } @@ -284,7 +278,7 @@ inline void PointerArray::SetElementPtrSize(uint32_t idx, T* element, PointerSiz } template -inline void PointerArray::Fixup(mirror::PointerArray* dest, +inline void PointerArray::Fixup(ObjPtr dest, PointerSize pointer_size, const Visitor& visitor) { for (size_t i = 0, count = GetLength(); i < count; ++i) { -- cgit v1.2.3-59-g8ed1b