summaryrefslogtreecommitdiff
path: root/runtime/native/dalvik_system_VMRuntime.cc
diff options
context:
space:
mode:
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));
}