src/share/vm/utilities/copy.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/utilities

src/share/vm/utilities/copy.hpp

Print this page
rev 10065 : imported patch unsafecopyswap
rev 10066 : imported patch unsafecopyswap2


 211     }
 212   }
 213 
 214   // Copy word-aligned words from lower to higher addresses, not atomic on each word
 215   inline static void conjoint_words_to_higher(HeapWord* from, HeapWord* to, size_t byte_count) {
 216     // byte_count is in bytes to check its alignment
 217     assert_params_ok(from, to, LogHeapWordSize);
 218     assert_byte_count_ok(byte_count, HeapWordSize);
 219 
 220     size_t count = (size_t)round_to(byte_count, HeapWordSize) >> LogHeapWordSize;
 221     assert(from <= to || to + count <= from, "do not overwrite source data");
 222 
 223     from += count - 1;
 224     to   += count - 1;
 225     while (count-- > 0) {
 226       *to-- = *from--;
 227     }
 228   }
 229 
 230   /**
 231    * Copy and byte swap elements
 232    *
 233    * @param src address of source
 234    * @param dst address of destination
 235    * @param byte_count number of bytes to copy
 236    * @param elem_size size of the elements to copy-swap
 237    */
 238   static void conjoint_swap(address src, address dst, size_t byte_count, size_t elem_size);
 239 
 240   // Fill methods
 241 
 242   // Fill word-aligned words, not atomic on each word
 243   // set_words
 244   static void fill_to_words(HeapWord* to, size_t count, juint value = 0) {
 245     assert_params_ok(to, LogHeapWordSize);
 246     pd_fill_to_words(to, count, value);
 247   }
 248 
 249   static void fill_to_aligned_words(HeapWord* to, size_t count, juint value = 0) {
 250     assert_params_aligned(to);
 251     pd_fill_to_aligned_words(to, count, value);




 211     }
 212   }
 213 
 214   // Copy word-aligned words from lower to higher addresses, not atomic on each word
 215   inline static void conjoint_words_to_higher(HeapWord* from, HeapWord* to, size_t byte_count) {
 216     // byte_count is in bytes to check its alignment
 217     assert_params_ok(from, to, LogHeapWordSize);
 218     assert_byte_count_ok(byte_count, HeapWordSize);
 219 
 220     size_t count = (size_t)round_to(byte_count, HeapWordSize) >> LogHeapWordSize;
 221     assert(from <= to || to + count <= from, "do not overwrite source data");
 222 
 223     from += count - 1;
 224     to   += count - 1;
 225     while (count-- > 0) {
 226       *to-- = *from--;
 227     }
 228   }
 229 
 230   /**
 231    * Copy and *unconditionally* byte swap elements
 232    *
 233    * @param src address of source
 234    * @param dst address of destination
 235    * @param byte_count number of bytes to copy
 236    * @param elem_size size of the elements to copy-swap
 237    */
 238   static void conjoint_swap(address src, address dst, size_t byte_count, size_t elem_size);
 239 
 240   // Fill methods
 241 
 242   // Fill word-aligned words, not atomic on each word
 243   // set_words
 244   static void fill_to_words(HeapWord* to, size_t count, juint value = 0) {
 245     assert_params_ok(to, LogHeapWordSize);
 246     pd_fill_to_words(to, count, value);
 247   }
 248 
 249   static void fill_to_aligned_words(HeapWord* to, size_t count, juint value = 0) {
 250     assert_params_aligned(to);
 251     pd_fill_to_aligned_words(to, count, value);


src/share/vm/utilities/copy.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File