From 33d6903e570daf8f3cf7c1f6ebd9a6dd22c7c23c Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Thu, 18 Jun 2015 18:20:59 +0100 Subject: Replace some run-time assertions with compile-time ones in ART. Change-Id: I16c3fad45c4b98b94b7c83d071374096e81d407a --- runtime/mirror/object_array-inl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/mirror/object_array-inl.h') 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::AssignableMemmove(int32_t dst_pos, ObjectArray* s } } // Perform the memmove using int memmove then perform the write barrier. - CHECK_EQ(sizeof(HeapReference), sizeof(uint32_t)); + static_assert(sizeof(HeapReference) == sizeof(uint32_t), + "art::mirror::HeapReference and uint32_t have different sizes."); IntArray* dstAsIntArray = reinterpret_cast(this); IntArray* srcAsIntArray = reinterpret_cast(src); if (kUseReadBarrier) { @@ -172,7 +173,8 @@ inline void ObjectArray::AssignableMemcpy(int32_t dst_pos, ObjectArray* sr } } // Perform the memmove using int memcpy then perform the write barrier. - CHECK_EQ(sizeof(HeapReference), sizeof(uint32_t)); + static_assert(sizeof(HeapReference) == sizeof(uint32_t), + "art::mirror::HeapReference and uint32_t have different sizes."); IntArray* dstAsIntArray = reinterpret_cast(this); IntArray* srcAsIntArray = reinterpret_cast(src); if (kUseReadBarrier) { -- cgit v1.2.3-59-g8ed1b