summaryrefslogtreecommitdiff
path: root/runtime/mirror/array-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/array-inl.h')
-rw-r--r--runtime/mirror/array-inl.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h
index 3a0cbe2a59..19d35a89ec 100644
--- a/runtime/mirror/array-inl.h
+++ b/runtime/mirror/array-inl.h
@@ -22,7 +22,6 @@
#include <android-base/logging.h>
#include "base/bit_utils.h"
-#include "base/casts.h"
#include "class.h"
#include "obj_ptr-inl.h"
#include "runtime.h"
@@ -253,11 +252,11 @@ inline T PointerArray::GetElementPtrSize(uint32_t idx, PointerSize ptr_size) {
template<bool kTransactionActive, bool kUnchecked>
inline void PointerArray::SetElementPtrSize(uint32_t idx, uint64_t element, PointerSize ptr_size) {
if (ptr_size == PointerSize::k64) {
- (kUnchecked ? down_cast<LongArray*>(static_cast<Object*>(this)) : AsLongArray())->
+ (kUnchecked ? ObjPtr<LongArray>::DownCast(ObjPtr<Object>(this)) : AsLongArray())->
SetWithoutChecks<kTransactionActive>(idx, element);
} else {
DCHECK_LE(element, static_cast<uint64_t>(0xFFFFFFFFu));
- (kUnchecked ? down_cast<IntArray*>(static_cast<Object*>(this)) : AsIntArray())
+ (kUnchecked ? ObjPtr<IntArray>::DownCast(ObjPtr<Object>(this)) : AsIntArray())
->SetWithoutChecks<kTransactionActive>(idx, static_cast<uint32_t>(element));
}
}
@@ -291,16 +290,16 @@ void PointerArray::Memcpy(int32_t dst_pos,
DCHECK(!Runtime::Current()->IsActiveTransaction());
DCHECK(!src.IsNull());
if (ptr_size == PointerSize::k64) {
- LongArray* l_this = (kUnchecked ? down_cast<LongArray*>(static_cast<Object*>(this))
- : AsLongArray());
- LongArray* l_src = (kUnchecked ? down_cast<LongArray*>(static_cast<Object*>(src.Ptr()))
- : src->AsLongArray());
+ ObjPtr<LongArray> l_this = (kUnchecked ? ObjPtr<LongArray>::DownCast(ObjPtr<Object>(this))
+ : AsLongArray());
+ ObjPtr<LongArray> l_src = (kUnchecked ? ObjPtr<LongArray>::DownCast(ObjPtr<Object>(src))
+ : src->AsLongArray());
l_this->Memcpy(dst_pos, l_src, src_pos, count);
} else {
- IntArray* i_this = (kUnchecked ? down_cast<IntArray*>(static_cast<Object*>(this))
- : AsIntArray());
- IntArray* i_src = (kUnchecked ? down_cast<IntArray*>(static_cast<Object*>(src.Ptr()))
- : src->AsIntArray());
+ ObjPtr<IntArray> i_this = (kUnchecked ? ObjPtr<IntArray>::DownCast(ObjPtr<Object>(this))
+ : AsIntArray());
+ ObjPtr<IntArray> i_src = (kUnchecked ? ObjPtr<IntArray>::DownCast(ObjPtr<Object>(src.Ptr()))
+ : src->AsIntArray());
i_this->Memcpy(dst_pos, i_src, src_pos, count);
}
}