summaryrefslogtreecommitdiff
path: root/runtime/mirror/array-alloc-inl.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2019-03-28 13:18:57 +0000
committer Vladimir Marko <vmarko@google.com> 2019-03-29 09:50:00 +0000
commitd7e9bbf092b5a61048358fd54183526ef12284af (patch)
tree620cee17c499bdb23217224b0b1332408d725a6e /runtime/mirror/array-alloc-inl.h
parentbb206de72135271e66e58576b1196f3e08d5b6fd (diff)
Clean up explicit conversions to ObjPtr<>.
Add an ObjPtr<>::DownCast() overload that takes a plain pointer and remove unnecessary calls to MakeObjPtr(), usually preceding DownCast(). Move the MakeObjPtr() to common_art_test.h . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 31113334 Change-Id: I2a243b6d8f3b2e773396dfc53b659c5f7d9ea44a
Diffstat (limited to 'runtime/mirror/array-alloc-inl.h')
-rw-r--r--runtime/mirror/array-alloc-inl.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/mirror/array-alloc-inl.h b/runtime/mirror/array-alloc-inl.h
index 4250ff8c70..2ae4cab59c 100644
--- a/runtime/mirror/array-alloc-inl.h
+++ b/runtime/mirror/array-alloc-inl.h
@@ -142,16 +142,16 @@ inline ObjPtr<Array> Array::Alloc(Thread* self,
ObjPtr<Array> result;
if (!kFillUsable) {
SetLengthVisitor visitor(component_count);
- result = ObjPtr<Array>::DownCast(MakeObjPtr(
- heap->AllocObjectWithAllocator<kIsInstrumented, true>(self, array_class, size,
- allocator_type, visitor)));
+ result = ObjPtr<Array>::DownCast(
+ heap->AllocObjectWithAllocator<kIsInstrumented, true>(
+ self, array_class, size, allocator_type, visitor));
} else {
SetLengthToUsableSizeVisitor visitor(component_count,
DataOffset(1U << component_size_shift).SizeValue(),
component_size_shift);
- result = ObjPtr<Array>::DownCast(MakeObjPtr(
- heap->AllocObjectWithAllocator<kIsInstrumented, true>(self, array_class, size,
- allocator_type, visitor)));
+ result = ObjPtr<Array>::DownCast(
+ heap->AllocObjectWithAllocator<kIsInstrumented, true>(
+ self, array_class, size, allocator_type, visitor));
}
if (kIsDebugBuild && result != nullptr && Runtime::Current()->IsStarted()) {
array_class = result->GetClass(); // In case the array class moved.