summaryrefslogtreecommitdiff
path: root/runtime/mirror/array.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2024-09-04 00:27:53 +0000
committer Hans Boehm <hboehm@google.com> 2024-09-26 15:14:48 +0000
commitea269f69d05fe333e4b36634b925c3c40fc8ce95 (patch)
treedb1feb8fb32fd875bf899a45409610da99aa30f0 /runtime/mirror/array.cc
parentf255d9c2c508443ae4a0fb57f903db46ff3e39be (diff)
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
Diffstat (limited to 'runtime/mirror/array.cc')
-rw-r--r--runtime/mirror/array.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/mirror/array.cc b/runtime/mirror/array.cc
index a4f6c88e4c..65371d0f5e 100644
--- a/runtime/mirror/array.cc
+++ b/runtime/mirror/array.cc
@@ -144,9 +144,8 @@ ObjPtr<Array> Array::CopyOf(Handle<Array> h_this, Thread* self, int32_t new_leng
CHECK(klass->IsPrimitiveArray()) << "Will miss write barriers";
DCHECK_GE(new_length, 0);
auto* heap = Runtime::Current()->GetHeap();
- gc::AllocatorType allocator_type = heap->IsMovableObject(h_this.Get())
- ? heap->GetCurrentAllocator()
- : heap->GetCurrentNonMovingAllocator();
+ DCHECK(!heap->IsNonMovable(h_this.Get()));
+ gc::AllocatorType allocator_type = heap->GetCurrentAllocator();
const auto component_size = klass->GetComponentSize();
const auto component_shift = klass->GetComponentSizeShift();
ObjPtr<Array> new_array =