src/share/vm/utilities/copy.hpp

changeset 1958
d93949c5bdcc
parent 1934
e9ff18c4ace7
child 2314
f95d63e2154a
     1.1 --- a/src/share/vm/utilities/copy.hpp	Wed Jun 09 18:50:45 2010 -0700
     1.2 +++ b/src/share/vm/utilities/copy.hpp	Thu Jun 10 13:04:20 2010 -0700
     1.3 @@ -73,6 +73,9 @@
     1.4    // whole alignment units.  E.g., if BytesPerLong is 2x word alignment, an odd
     1.5    // count may copy an extra word.  In the arrayof case, we are allowed to copy
     1.6    // only the number of copy units specified.
     1.7 +  //
     1.8 +  // All callees check count for 0.
     1.9 +  //
    1.10  
    1.11    // HeapWords
    1.12  
    1.13 @@ -99,7 +102,6 @@
    1.14    // Object-aligned words,  conjoint, not atomic on each word
    1.15    static void aligned_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
    1.16      assert_params_aligned(from, to);
    1.17 -    assert_non_zero(count);
    1.18      pd_aligned_conjoint_words(from, to, count);
    1.19    }
    1.20  
    1.21 @@ -107,49 +109,42 @@
    1.22    static void aligned_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
    1.23      assert_params_aligned(from, to);
    1.24      assert_disjoint(from, to, count);
    1.25 -    assert_non_zero(count);
    1.26      pd_aligned_disjoint_words(from, to, count);
    1.27    }
    1.28  
    1.29    // bytes, jshorts, jints, jlongs, oops
    1.30  
    1.31    // bytes,                 conjoint, not atomic on each byte (not that it matters)
    1.32 -  static void conjoint_bytes(void* from, void* to, size_t count) {
    1.33 -    assert_non_zero(count);
    1.34 +  static void conjoint_jbytes(void* from, void* to, size_t count) {
    1.35      pd_conjoint_bytes(from, to, count);
    1.36    }
    1.37  
    1.38    // bytes,                 conjoint, atomic on each byte (not that it matters)
    1.39 -  static void conjoint_bytes_atomic(void* from, void* to, size_t count) {
    1.40 -    assert_non_zero(count);
    1.41 +  static void conjoint_jbytes_atomic(void* from, void* to, size_t count) {
    1.42      pd_conjoint_bytes(from, to, count);
    1.43    }
    1.44  
    1.45    // jshorts,               conjoint, atomic on each jshort
    1.46    static void conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
    1.47      assert_params_ok(from, to, LogBytesPerShort);
    1.48 -    assert_non_zero(count);
    1.49      pd_conjoint_jshorts_atomic(from, to, count);
    1.50    }
    1.51  
    1.52    // jints,                 conjoint, atomic on each jint
    1.53    static void conjoint_jints_atomic(jint* from, jint* to, size_t count) {
    1.54      assert_params_ok(from, to, LogBytesPerInt);
    1.55 -    assert_non_zero(count);
    1.56      pd_conjoint_jints_atomic(from, to, count);
    1.57    }
    1.58  
    1.59    // jlongs,                conjoint, atomic on each jlong
    1.60    static void conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) {
    1.61      assert_params_ok(from, to, LogBytesPerLong);
    1.62 -    assert_non_zero(count);
    1.63      pd_conjoint_jlongs_atomic(from, to, count);
    1.64    }
    1.65  
    1.66    // oops,                  conjoint, atomic on each oop
    1.67    static void conjoint_oops_atomic(oop* from, oop* to, size_t count) {
    1.68      assert_params_ok(from, to, LogBytesPerHeapOop);
    1.69 -    assert_non_zero(count);
    1.70      pd_conjoint_oops_atomic(from, to, count);
    1.71    }
    1.72  
    1.73 @@ -157,7 +152,6 @@
    1.74    static void conjoint_oops_atomic(narrowOop* from, narrowOop* to, size_t count) {
    1.75      assert(sizeof(narrowOop) == sizeof(jint), "this cast is wrong");
    1.76      assert_params_ok(from, to, LogBytesPerInt);
    1.77 -    assert_non_zero(count);
    1.78      pd_conjoint_jints_atomic((jint*)from, (jint*)to, count);
    1.79    }
    1.80  
    1.81 @@ -168,36 +162,31 @@
    1.82    static void conjoint_memory_atomic(void* from, void* to, size_t size);
    1.83  
    1.84    // bytes,                 conjoint array, atomic on each byte (not that it matters)
    1.85 -  static void arrayof_conjoint_bytes(HeapWord* from, HeapWord* to, size_t count) {
    1.86 -    assert_non_zero(count);
    1.87 +  static void arrayof_conjoint_jbytes(HeapWord* from, HeapWord* to, size_t count) {
    1.88      pd_arrayof_conjoint_bytes(from, to, count);
    1.89    }
    1.90  
    1.91    // jshorts,               conjoint array, atomic on each jshort
    1.92    static void arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to, size_t count) {
    1.93      assert_params_ok(from, to, LogBytesPerShort);
    1.94 -    assert_non_zero(count);
    1.95      pd_arrayof_conjoint_jshorts(from, to, count);
    1.96    }
    1.97  
    1.98    // jints,                 conjoint array, atomic on each jint
    1.99    static void arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count) {
   1.100      assert_params_ok(from, to, LogBytesPerInt);
   1.101 -    assert_non_zero(count);
   1.102      pd_arrayof_conjoint_jints(from, to, count);
   1.103    }
   1.104  
   1.105    // jlongs,                conjoint array, atomic on each jlong
   1.106    static void arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) {
   1.107      assert_params_ok(from, to, LogBytesPerLong);
   1.108 -    assert_non_zero(count);
   1.109      pd_arrayof_conjoint_jlongs(from, to, count);
   1.110    }
   1.111  
   1.112    // oops,                  conjoint array, atomic on each oop
   1.113    static void arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
   1.114      assert_params_ok(from, to, LogBytesPerHeapOop);
   1.115 -    assert_non_zero(count);
   1.116      pd_arrayof_conjoint_oops(from, to, count);
   1.117    }
   1.118  
   1.119 @@ -319,14 +308,6 @@
   1.120  #endif
   1.121    }
   1.122  
   1.123 -  static void assert_non_zero(size_t count) {
   1.124 -#ifdef ASSERT
   1.125 -    if (count == 0) {
   1.126 -      basic_fatal("count must be non-zero");
   1.127 -    }
   1.128 -#endif
   1.129 -  }
   1.130 -
   1.131    static void assert_byte_count_ok(size_t byte_count, size_t unit_size) {
   1.132  #ifdef ASSERT
   1.133      if ((size_t)round_to(byte_count, unit_size) != byte_count) {

mercurial