< prev index next >

src/os_cpu/windows_x86/vm/atomic_windows_x86.hpp

Print this page
rev 13452 : imported patch Atomic_cmpxchg
rev 13453 : imported patch Atomic_add
rev 13454 : [mq]: Atomic_add_v2


  48 
  49 inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; }
  50 inline void Atomic::store_ptr(void*    store_value, void*     dest) { *(void**)dest = store_value; }
  51 
  52 inline void Atomic::store    (jbyte    store_value, volatile jbyte*    dest) { *dest = store_value; }
  53 inline void Atomic::store    (jshort   store_value, volatile jshort*   dest) { *dest = store_value; }
  54 inline void Atomic::store    (jint     store_value, volatile jint*     dest) { *dest = store_value; }
  55 
  56 
  57 inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; }
  58 inline void Atomic::store_ptr(void*    store_value, volatile void*     dest) { *(void* volatile *)dest = store_value; }
  59 
  60 template<size_t byte_size>
  61 struct Atomic::PlatformAdd
  62   : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> >
  63 {
  64   template<typename I, typename D>
  65   D add_and_fetch(I add_value, D volatile* dest) const;
  66 };
  67 



  68 #ifdef AMD64
  69 inline void Atomic::store    (jlong    store_value, jlong*    dest) { *dest = store_value; }
  70 inline void Atomic::store    (jlong    store_value, volatile jlong*    dest) { *dest = store_value; }
  71 
  72 template<>
  73 template<typename I, typename D>
  74 inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest) const {
  75   return add_using_helper<jint>(os::atomic_add_func, add_value, dest);
  76 }
  77 
  78 template<>
  79 template<typename I, typename D>
  80 inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest) const {
  81   return add_using_helper<intptr_t>(os::atomic_add_ptr_func, add_value, dest);
  82 }
  83 
  84 inline void Atomic::inc    (volatile jint*     dest) {
  85   (void)add    (1, dest);
  86 }
  87 




  48 
  49 inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; }
  50 inline void Atomic::store_ptr(void*    store_value, void*     dest) { *(void**)dest = store_value; }
  51 
  52 inline void Atomic::store    (jbyte    store_value, volatile jbyte*    dest) { *dest = store_value; }
  53 inline void Atomic::store    (jshort   store_value, volatile jshort*   dest) { *dest = store_value; }
  54 inline void Atomic::store    (jint     store_value, volatile jint*     dest) { *dest = store_value; }
  55 
  56 
  57 inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; }
  58 inline void Atomic::store_ptr(void*    store_value, volatile void*     dest) { *(void* volatile *)dest = store_value; }
  59 
  60 template<size_t byte_size>
  61 struct Atomic::PlatformAdd
  62   : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> >
  63 {
  64   template<typename I, typename D>
  65   D add_and_fetch(I add_value, D volatile* dest) const;
  66 };
  67 
  68 template<>
  69 struct Atomic::PlatformAdd<2>: Atomic::AddShortUsingInt {};
  70 
  71 #ifdef AMD64
  72 inline void Atomic::store    (jlong    store_value, jlong*    dest) { *dest = store_value; }
  73 inline void Atomic::store    (jlong    store_value, volatile jlong*    dest) { *dest = store_value; }
  74 
  75 template<>
  76 template<typename I, typename D>
  77 inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest) const {
  78   return add_using_helper<jint>(os::atomic_add_func, add_value, dest);
  79 }
  80 
  81 template<>
  82 template<typename I, typename D>
  83 inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest) const {
  84   return add_using_helper<intptr_t>(os::atomic_add_ptr_func, add_value, dest);
  85 }
  86 
  87 inline void Atomic::inc    (volatile jint*     dest) {
  88   (void)add    (1, dest);
  89 }
  90 


< prev index next >