hotspot/src/share/vm/runtime/atomic.hpp
changeset 46618 d503911aa948
parent 46523 cbcc0ebaa044
child 46619 a3919f5e8d2b
equal deleted inserted replaced
46617:0330c5fc49ce 46618:d503911aa948
   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       static_cast<volatile jint*>(align_ptr_down(dest, sizeof(jint)));
   156       reinterpret_cast<volatile jint*>(align_ptr_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