hotspot/src/share/vm/runtime/atomic.hpp
changeset 46619 a3919f5e8d2b
parent 46618 d503911aa948
child 46625 edefffab74e2
equal deleted inserted replaced
46618:d503911aa948 46619:a3919f5e8d2b
   151  */
   151  */
   152 inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest,
   152 inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest,
   153                              jbyte compare_value, cmpxchg_memory_order order) {
   153                              jbyte compare_value, cmpxchg_memory_order order) {
   154   STATIC_ASSERT(sizeof(jbyte) == 1);
   154   STATIC_ASSERT(sizeof(jbyte) == 1);
   155   volatile jint* dest_int =
   155   volatile jint* dest_int =
   156       reinterpret_cast<volatile jint*>(align_ptr_down(dest, sizeof(jint)));
   156       reinterpret_cast<volatile jint*>(align_down(dest, sizeof(jint)));
   157   size_t offset = pointer_delta(dest, dest_int, 1);
   157   size_t offset = pointer_delta(dest, dest_int, 1);
   158   jint cur = *dest_int;
   158   jint cur = *dest_int;
   159   jbyte* cur_as_bytes = reinterpret_cast<jbyte*>(&cur);
   159   jbyte* cur_as_bytes = reinterpret_cast<jbyte*>(&cur);
   160 
   160 
   161   // current value may not be what we are looking for, so force it
   161   // current value may not be what we are looking for, so force it