Mercurial > hg > truffle
diff src/share/vm/utilities/copy.hpp @ 1608:2389669474a6
Merge
author | jrose |
---|---|
date | Tue, 15 Jun 2010 15:57:36 -0700 |
parents | d93949c5bdcc |
children | f95d63e2154a |
line wrap: on
line diff
--- a/src/share/vm/utilities/copy.hpp Thu Jun 10 08:27:35 2010 -0700 +++ b/src/share/vm/utilities/copy.hpp Tue Jun 15 15:57:36 2010 -0700 @@ -73,6 +73,9 @@ // whole alignment units. E.g., if BytesPerLong is 2x word alignment, an odd // count may copy an extra word. In the arrayof case, we are allowed to copy // only the number of copy units specified. + // + // All callees check count for 0. + // // HeapWords @@ -99,7 +102,6 @@ // Object-aligned words, conjoint, not atomic on each word static void aligned_conjoint_words(HeapWord* from, HeapWord* to, size_t count) { assert_params_aligned(from, to); - assert_non_zero(count); pd_aligned_conjoint_words(from, to, count); } @@ -107,49 +109,42 @@ static void aligned_disjoint_words(HeapWord* from, HeapWord* to, size_t count) { assert_params_aligned(from, to); assert_disjoint(from, to, count); - assert_non_zero(count); pd_aligned_disjoint_words(from, to, count); } // bytes, jshorts, jints, jlongs, oops // bytes, conjoint, not atomic on each byte (not that it matters) - static void conjoint_bytes(void* from, void* to, size_t count) { - assert_non_zero(count); + static void conjoint_jbytes(void* from, void* to, size_t count) { pd_conjoint_bytes(from, to, count); } // bytes, conjoint, atomic on each byte (not that it matters) - static void conjoint_bytes_atomic(void* from, void* to, size_t count) { - assert_non_zero(count); + static void conjoint_jbytes_atomic(void* from, void* to, size_t count) { pd_conjoint_bytes(from, to, count); } // jshorts, conjoint, atomic on each jshort static void conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { assert_params_ok(from, to, LogBytesPerShort); - assert_non_zero(count); pd_conjoint_jshorts_atomic(from, to, count); } // jints, conjoint, atomic on each jint static void conjoint_jints_atomic(jint* from, jint* to, size_t count) { assert_params_ok(from, to, LogBytesPerInt); - assert_non_zero(count); pd_conjoint_jints_atomic(from, to, count); } // jlongs, conjoint, atomic on each jlong static void conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) { assert_params_ok(from, to, LogBytesPerLong); - assert_non_zero(count); pd_conjoint_jlongs_atomic(from, to, count); } // oops, conjoint, atomic on each oop static void conjoint_oops_atomic(oop* from, oop* to, size_t count) { assert_params_ok(from, to, LogBytesPerHeapOop); - assert_non_zero(count); pd_conjoint_oops_atomic(from, to, count); } @@ -157,7 +152,6 @@ static void conjoint_oops_atomic(narrowOop* from, narrowOop* to, size_t count) { assert(sizeof(narrowOop) == sizeof(jint), "this cast is wrong"); assert_params_ok(from, to, LogBytesPerInt); - assert_non_zero(count); pd_conjoint_jints_atomic((jint*)from, (jint*)to, count); } @@ -168,36 +162,31 @@ static void conjoint_memory_atomic(void* from, void* to, size_t size); // bytes, conjoint array, atomic on each byte (not that it matters) - static void arrayof_conjoint_bytes(HeapWord* from, HeapWord* to, size_t count) { - assert_non_zero(count); + static void arrayof_conjoint_jbytes(HeapWord* from, HeapWord* to, size_t count) { pd_arrayof_conjoint_bytes(from, to, count); } // jshorts, conjoint array, atomic on each jshort static void arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to, size_t count) { assert_params_ok(from, to, LogBytesPerShort); - assert_non_zero(count); pd_arrayof_conjoint_jshorts(from, to, count); } // jints, conjoint array, atomic on each jint static void arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count) { assert_params_ok(from, to, LogBytesPerInt); - assert_non_zero(count); pd_arrayof_conjoint_jints(from, to, count); } // jlongs, conjoint array, atomic on each jlong static void arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) { assert_params_ok(from, to, LogBytesPerLong); - assert_non_zero(count); pd_arrayof_conjoint_jlongs(from, to, count); } // oops, conjoint array, atomic on each oop static void arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) { assert_params_ok(from, to, LogBytesPerHeapOop); - assert_non_zero(count); pd_arrayof_conjoint_oops(from, to, count); } @@ -319,14 +308,6 @@ #endif } - static void assert_non_zero(size_t count) { -#ifdef ASSERT - if (count == 0) { - basic_fatal("count must be non-zero"); - } -#endif - } - static void assert_byte_count_ok(size_t byte_count, size_t unit_size) { #ifdef ASSERT if ((size_t)round_to(byte_count, unit_size) != byte_count) {