summaryrefslogtreecommitdiff
path: root/runtime/mirror/object_array-inl.h
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2015-06-18 18:20:59 +0100
committer Roland Levillain <rpl@google.com> 2015-06-18 18:20:59 +0100
commit33d6903e570daf8f3cf7c1f6ebd9a6dd22c7c23c (patch)
tree8069008292fe085d051300f1a871392dc413f820 /runtime/mirror/object_array-inl.h
parent822c00d0fe3b70d1f1fe5bac03713674d45f8173 (diff)
Replace some run-time assertions with compile-time ones in ART.
Change-Id: I16c3fad45c4b98b94b7c83d071374096e81d407a
Diffstat (limited to 'runtime/mirror/object_array-inl.h')
-rw-r--r--runtime/mirror/object_array-inl.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/mirror/object_array-inl.h b/runtime/mirror/object_array-inl.h
index bef4af617a..4a7e7b35da 100644
--- a/runtime/mirror/object_array-inl.h
+++ b/runtime/mirror/object_array-inl.h
@@ -129,7 +129,8 @@ inline void ObjectArray<T>::AssignableMemmove(int32_t dst_pos, ObjectArray<T>* s
}
}
// Perform the memmove using int memmove then perform the write barrier.
- CHECK_EQ(sizeof(HeapReference<T>), sizeof(uint32_t));
+ static_assert(sizeof(HeapReference<T>) == sizeof(uint32_t),
+ "art::mirror::HeapReference<T> and uint32_t have different sizes.");
IntArray* dstAsIntArray = reinterpret_cast<IntArray*>(this);
IntArray* srcAsIntArray = reinterpret_cast<IntArray*>(src);
if (kUseReadBarrier) {
@@ -172,7 +173,8 @@ inline void ObjectArray<T>::AssignableMemcpy(int32_t dst_pos, ObjectArray<T>* sr
}
}
// Perform the memmove using int memcpy then perform the write barrier.
- CHECK_EQ(sizeof(HeapReference<T>), sizeof(uint32_t));
+ static_assert(sizeof(HeapReference<T>) == sizeof(uint32_t),
+ "art::mirror::HeapReference<T> and uint32_t have different sizes.");
IntArray* dstAsIntArray = reinterpret_cast<IntArray*>(this);
IntArray* srcAsIntArray = reinterpret_cast<IntArray*>(src);
if (kUseReadBarrier) {