< prev index next >

src/cpu/sparc/vm/copy_sparc.hpp

Print this page




 163 
 164 static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
 165 #ifdef _LP64
 166   guarantee(mask_bits((uintptr_t)tohw, right_n_bits(LogBytesPerLong)) == 0,
 167          "unaligned fill words");
 168   julong* to = (julong*)tohw;
 169   julong  v  = ((julong)value << 32) | value;
 170   while (count-- > 0) {
 171     *to++ = v;
 172   }
 173 #else // _LP64
 174   juint* to = (juint*)tohw;
 175   while (count-- > 0) {
 176     *to++ = value;
 177   }
 178 #endif // _LP64
 179 }
 180 
 181 typedef void (*_zero_Fn)(HeapWord* to, size_t count);
 182 



 183 static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {
 184   assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation");
 185 
 186   if (value == 0 && UseBlockZeroing &&
 187       (count > (size_t)(BlockZeroingLowLimit >> LogHeapWordSize))) {
 188    // Call it only when block zeroing is used
 189    ((_zero_Fn)StubRoutines::zero_aligned_words())(tohw, count);
 190   } else {
 191    julong* to = (julong*)tohw;
 192    julong  v  = ((julong)value << 32) | value;
 193    // If count is odd, odd will be equal to 1 on 32-bit platform
 194    // and be equal to 0 on 64-bit platform.
 195    size_t odd = count % (BytesPerLong / HeapWordSize) ;
 196 
 197    size_t aligned_count = align_object_offset(count - odd) / HeapWordsPerLong;
 198    julong* end = ((julong*)tohw) + aligned_count - 1;
 199    while (to <= end) {
 200      DEBUG_ONLY(count -= BytesPerLong / HeapWordSize ;)
 201      *to++ = v;
 202    }




 163 
 164 static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) {
 165 #ifdef _LP64
 166   guarantee(mask_bits((uintptr_t)tohw, right_n_bits(LogBytesPerLong)) == 0,
 167          "unaligned fill words");
 168   julong* to = (julong*)tohw;
 169   julong  v  = ((julong)value << 32) | value;
 170   while (count-- > 0) {
 171     *to++ = v;
 172   }
 173 #else // _LP64
 174   juint* to = (juint*)tohw;
 175   while (count-- > 0) {
 176     *to++ = value;
 177   }
 178 #endif // _LP64
 179 }
 180 
 181 typedef void (*_zero_Fn)(HeapWord* to, size_t count);
 182 
 183 // Only used for heap objects, so align_object_offset.
 184 // All other platforms pd_fill_to_aligned_words simply calls pd_fill_to_words, don't
 185 // know why this one is different.
 186 static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {
 187   assert(MinObjAlignmentInBytes >= BytesPerLong, "need alternate implementation");
 188 
 189   if (value == 0 && UseBlockZeroing &&
 190       (count > (size_t)(BlockZeroingLowLimit >> LogHeapWordSize))) {
 191    // Call it only when block zeroing is used
 192    ((_zero_Fn)StubRoutines::zero_aligned_words())(tohw, count);
 193   } else {
 194    julong* to = (julong*)tohw;
 195    julong  v  = ((julong)value << 32) | value;
 196    // If count is odd, odd will be equal to 1 on 32-bit platform
 197    // and be equal to 0 on 64-bit platform.
 198    size_t odd = count % (BytesPerLong / HeapWordSize) ;
 199 
 200    size_t aligned_count = align_object_offset(count - odd) / HeapWordsPerLong;
 201    julong* end = ((julong*)tohw) + aligned_count - 1;
 202    while (to <= end) {
 203      DEBUG_ONLY(count -= BytesPerLong / HeapWordSize ;)
 204      *to++ = v;
 205    }


< prev index next >