summaryrefslogtreecommitdiff
path: root/runtime/native/dalvik_system_VMRuntime.cc
diff options
context:
space:
mode:
author Hans Boehm <hboehm@google.com> 2024-08-19 21:32:19 +0000
committer Hans Boehm <hboehm@google.com> 2024-08-19 23:48:03 +0000
commit7c89f49c2c542df1a5780fb851e2ef0e0909f48f (patch)
tree02bc90403e3f56bbb59c7fb1d89b785cd8257b28 /runtime/native/dalvik_system_VMRuntime.cc
parent806ace6dfa77cd65b05b20affb6a7e7072dcc845 (diff)
Revert "Object.clone() allocates more movable objects"
This reverts commit a5001fed23788c966fd87048d7f17ba8c0b51914. Reason for revert: b/360363656 Change-Id: Ibfea46976bb6434d728c69160edb5904ab7708aa
Diffstat (limited to 'runtime/native/dalvik_system_VMRuntime.cc')
-rw-r--r--runtime/native/dalvik_system_VMRuntime.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc
index 66c0fe6d39..0e9660aaac 100644
--- a/runtime/native/dalvik_system_VMRuntime.cc
+++ b/runtime/native/dalvik_system_VMRuntime.cc
@@ -116,11 +116,11 @@ static jobject VMRuntime_newNonMovableArray(JNIEnv* env, jobject, jclass javaEle
return nullptr;
}
gc::AllocatorType allocator = runtime->GetHeap()->GetCurrentNonMovingAllocator();
- // To keep these allocations distinguishable, do not fall back to LargeObjectsSpace:
- ObjPtr<mirror::Array> result = mirror::Array::Alloc</* kIsInstrumented= */ true,
- /* kfillUsable= */ false,
- /* kCheckLargeObject= */ false>(
- soa.Self(), array_class, length, array_class->GetComponentSizeShift(), allocator);
+ ObjPtr<mirror::Array> result = mirror::Array::Alloc(soa.Self(),
+ array_class,
+ length,
+ array_class->GetComponentSizeShift(),
+ allocator);
return soa.AddLocalReference<jobject>(result);
}
@@ -167,11 +167,10 @@ static jlong VMRuntime_addressOf(JNIEnv* env, jobject, jobject javaArray) {
ThrowIllegalArgumentException("not a primitive array");
return 0;
}
- if (!Runtime::Current()->GetHeap()->IsNonMovable(array)) {
+ if (Runtime::Current()->GetHeap()->IsMovableObject(array)) {
ThrowRuntimeException("Trying to get address of movable array object");
return 0;
}
- DCHECK(!Runtime::Current()->GetHeap()->ObjectMayMove(array));
return reinterpret_cast<uintptr_t>(array->GetRawData(array->GetClass()->GetComponentSize(), 0));
}