src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp
changeset 47552 8a3599d60996
parent 47216 71c04702a3d5
child 47578 09c41c4913d9
equal deleted inserted replaced
47551:4d034d861e13 47552:8a3599d60996
    55   D add_and_fetch(I add_value, D volatile* dest) const {
    55   D add_and_fetch(I add_value, D volatile* dest) const {
    56     return __sync_add_and_fetch(dest, add_value);
    56     return __sync_add_and_fetch(dest, add_value);
    57   }
    57   }
    58 };
    58 };
    59 
    59 
    60 inline void Atomic::inc(volatile jint* dest)
       
    61 {
       
    62  add(1, dest);
       
    63 }
       
    64 
       
    65 inline void Atomic::inc_ptr(volatile void* dest)
       
    66 {
       
    67  add_ptr(1, dest);
       
    68 }
       
    69 
       
    70 inline void Atomic::dec (volatile jint* dest)
       
    71 {
       
    72  add(-1, dest);
       
    73 }
       
    74 
       
    75 inline void Atomic::dec_ptr(volatile void* dest)
       
    76 {
       
    77  add_ptr(-1, dest);
       
    78 }
       
    79 
       
    80 inline jint Atomic::xchg (jint exchange_value, volatile jint* dest)
    60 inline jint Atomic::xchg (jint exchange_value, volatile jint* dest)
    81 {
    61 {
    82   jint res = __sync_lock_test_and_set (dest, exchange_value);
    62   jint res = __sync_lock_test_and_set (dest, exchange_value);
    83   FULL_MEM_BARRIER;
    63   FULL_MEM_BARRIER;
    84   return res;
    64   return res;
   108 }
    88 }
   109 
    89 
   110 inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
    90 inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; }
   111 inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
    91 inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; }
   112 
    92 
   113 inline void Atomic::inc_ptr(volatile intptr_t* dest)
       
   114 {
       
   115  add_ptr(1, dest);
       
   116 }
       
   117 
       
   118 inline void Atomic::dec_ptr(volatile intptr_t* dest)
       
   119 {
       
   120  add_ptr(-1, dest);
       
   121 }
       
   122 
       
   123 inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest)
    93 inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest)
   124 {
    94 {
   125   intptr_t res = __sync_lock_test_and_set (dest, exchange_value);
    95   intptr_t res = __sync_lock_test_and_set (dest, exchange_value);
   126   FULL_MEM_BARRIER;
    96   FULL_MEM_BARRIER;
   127   return res;
    97   return res;