From ea269f69d05fe333e4b36634b925c3c40fc8ce95 Mon Sep 17 00:00:00 2001 From: Hans Boehm Date: Wed, 4 Sep 2024 00:27:53 +0000 Subject: Revert^4 "Object.clone() allocates more movable objects" This reverts commit fc0ed57a5f25d8a7b3fbf200224bd880ed05eff5. PS1 is identical to aosp/3231043 PS2 adds 2280-address-of test, re-allows non-movable objects to be allocated in LOS, and more generally tracks non-movable objects in other spaces. PS3 Style tweak PS4 Disable test on jvm Bug: 355291033 Bug: 354087169 Bug: 360363656 Bug: 361327909 Bug: 364629185 Test: Build and boot AOSP Test: testrunner.py --host -b --all-gc -t 2280-address-of Change-Id: I4b2929c353a6ede916762de509056817f001d6f8 --- runtime/mirror/array-alloc-inl.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'runtime/mirror/array-alloc-inl.h') diff --git a/runtime/mirror/array-alloc-inl.h b/runtime/mirror/array-alloc-inl.h index b905fd1727..69d2e2017f 100644 --- a/runtime/mirror/array-alloc-inl.h +++ b/runtime/mirror/array-alloc-inl.h @@ -143,16 +143,14 @@ inline ObjPtr Array::Alloc(Thread* self, ObjPtr result; if (!kFillUsable) { SetLengthVisitor visitor(component_count); - result = ObjPtr::DownCast( - heap->AllocObjectWithAllocator( - self, array_class, size, allocator_type, visitor)); + result = ObjPtr::DownCast(heap->AllocObjectWithAllocator( + self, array_class, size, allocator_type, visitor)); } else { SetLengthToUsableSizeVisitor visitor(component_count, DataOffset(1U << component_size_shift).SizeValue(), component_size_shift); - result = ObjPtr::DownCast( - heap->AllocObjectWithAllocator( - self, array_class, size, allocator_type, visitor)); + result = ObjPtr::DownCast(heap->AllocObjectWithAllocator( + self, array_class, size, allocator_type, visitor)); } if (kIsDebugBuild && result != nullptr && Runtime::Current()->IsStarted()) { array_class = result->GetClass(); // In case the array class moved. -- cgit v1.2.3-59-g8ed1b