hotspot/src/os_cpu/linux_x86/vm/atomic_linux_x86.inline.hpp
changeset 27691 733f189ad1f7
parent 25715 d5a8dbdc5150
child 39404 d0ad5220e91c
equal deleted inserted replaced
27690:9c0821840cf2 27691:733f189ad1f7
    86 
    86 
    87 inline void*    Atomic::xchg_ptr(void*    exchange_value, volatile void*     dest) {
    87 inline void*    Atomic::xchg_ptr(void*    exchange_value, volatile void*     dest) {
    88   return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest);
    88   return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest);
    89 }
    89 }
    90 
    90 
       
    91 #define VM_HAS_SPECIALIZED_CMPXCHG_BYTE
       
    92 inline jbyte    Atomic::cmpxchg    (jbyte    exchange_value, volatile jbyte*    dest, jbyte    compare_value) {
       
    93   int mp = os::is_MP();
       
    94   __asm__ volatile (LOCK_IF_MP(%4) "cmpxchgb %1,(%3)"
       
    95                     : "=a" (exchange_value)
       
    96                     : "q" (exchange_value), "a" (compare_value), "r" (dest), "r" (mp)
       
    97                     : "cc", "memory");
       
    98   return exchange_value;
       
    99 }
    91 
   100 
    92 inline jint     Atomic::cmpxchg    (jint     exchange_value, volatile jint*     dest, jint     compare_value) {
   101 inline jint     Atomic::cmpxchg    (jint     exchange_value, volatile jint*     dest, jint     compare_value) {
    93   int mp = os::is_MP();
   102   int mp = os::is_MP();
    94   __asm__ volatile (LOCK_IF_MP(%4) "cmpxchgl %1,(%3)"
   103   __asm__ volatile (LOCK_IF_MP(%4) "cmpxchgl %1,(%3)"
    95                     : "=a" (exchange_value)
   104                     : "=a" (exchange_value)