1.1 --- a/src/share/vm/runtime/atomic.hpp Fri Nov 30 11:44:05 2012 -0800 1.2 +++ b/src/share/vm/runtime/atomic.hpp Fri Nov 30 15:23:16 2012 -0800 1.3 @@ -30,60 +30,59 @@ 1.4 class Atomic : AllStatic { 1.5 public: 1.6 // Atomically store to a location 1.7 - static void store (jbyte store_value, jbyte* dest); 1.8 - static void store (jshort store_value, jshort* dest); 1.9 - static void store (jint store_value, jint* dest); 1.10 - static void store (jlong store_value, jlong* dest); 1.11 - static void store_ptr(intptr_t store_value, intptr_t* dest); 1.12 - static void store_ptr(void* store_value, void* dest); 1.13 + inline static void store (jbyte store_value, jbyte* dest); 1.14 + inline static void store (jshort store_value, jshort* dest); 1.15 + inline static void store (jint store_value, jint* dest); 1.16 + inline static void store (jlong store_value, jlong* dest); 1.17 + inline static void store_ptr(intptr_t store_value, intptr_t* dest); 1.18 + inline static void store_ptr(void* store_value, void* dest); 1.19 1.20 - static void store (jbyte store_value, volatile jbyte* dest); 1.21 - static void store (jshort store_value, volatile jshort* dest); 1.22 - static void store (jint store_value, volatile jint* dest); 1.23 - static void store (jlong store_value, volatile jlong* dest); 1.24 - static void store_ptr(intptr_t store_value, volatile intptr_t* dest); 1.25 - static void store_ptr(void* store_value, volatile void* dest); 1.26 + inline static void store (jbyte store_value, volatile jbyte* dest); 1.27 + inline static void store (jshort store_value, volatile jshort* dest); 1.28 + inline static void store (jint store_value, volatile jint* dest); 1.29 + inline static void store (jlong store_value, volatile jlong* dest); 1.30 + inline static void store_ptr(intptr_t store_value, volatile intptr_t* dest); 1.31 + inline static void store_ptr(void* store_value, volatile void* dest); 1.32 1.33 - static jlong load(volatile jlong* src); 1.34 + inline static jlong load(volatile jlong* src); 1.35 1.36 // Atomically add to a location, return updated value 1.37 - static jint add (jint add_value, volatile jint* dest); 1.38 - static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest); 1.39 - static void* add_ptr(intptr_t add_value, volatile void* dest); 1.40 + inline static jint add (jint add_value, volatile jint* dest); 1.41 + inline static intptr_t add_ptr(intptr_t add_value, volatile intptr_t* dest); 1.42 + inline static void* add_ptr(intptr_t add_value, volatile void* dest); 1.43 1.44 - static jlong add (jlong add_value, volatile jlong* dest); 1.45 + static jlong add (jlong add_value, volatile jlong* dest); 1.46 1.47 // Atomically increment location 1.48 - static void inc (volatile jint* dest); 1.49 - static void inc_ptr(volatile intptr_t* dest); 1.50 - static void inc_ptr(volatile void* dest); 1.51 + inline static void inc (volatile jint* dest); 1.52 + inline static void inc_ptr(volatile intptr_t* dest); 1.53 + inline static void inc_ptr(volatile void* dest); 1.54 1.55 // Atomically decrement a location 1.56 - static void dec (volatile jint* dest); 1.57 - static void dec_ptr(volatile intptr_t* dest); 1.58 - static void dec_ptr(volatile void* dest); 1.59 + inline static void dec (volatile jint* dest); 1.60 + inline static void dec_ptr(volatile intptr_t* dest); 1.61 + inline static void dec_ptr(volatile void* dest); 1.62 1.63 // Performs atomic exchange of *dest with exchange_value. Returns old prior value of *dest. 1.64 - static jint xchg(jint exchange_value, volatile jint* dest); 1.65 - static unsigned int xchg(unsigned int exchange_value, 1.66 - volatile unsigned int* dest); 1.67 + inline static jint xchg(jint exchange_value, volatile jint* dest); 1.68 + static unsigned int xchg(unsigned int exchange_value, volatile unsigned int* dest); 1.69 1.70 - static intptr_t xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest); 1.71 - static void* xchg_ptr(void* exchange_value, volatile void* dest); 1.72 + inline static intptr_t xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest); 1.73 + inline static void* xchg_ptr(void* exchange_value, volatile void* dest); 1.74 1.75 // Performs atomic compare of *dest and compare_value, and exchanges *dest with exchange_value 1.76 // if the comparison succeeded. Returns prior value of *dest. Guarantees a two-way memory 1.77 // barrier across the cmpxchg. I.e., it's really a 'fence_cmpxchg_acquire'. 1.78 - static jbyte cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value); 1.79 - static jint cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value); 1.80 - static jlong cmpxchg (jlong exchange_value, volatile jlong* dest, jlong compare_value); 1.81 + static jbyte cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value); 1.82 + inline static jint cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value); 1.83 + inline static jlong cmpxchg (jlong exchange_value, volatile jlong* dest, jlong compare_value); 1.84 1.85 - static unsigned int cmpxchg(unsigned int exchange_value, 1.86 - volatile unsigned int* dest, 1.87 - unsigned int compare_value); 1.88 + static unsigned int cmpxchg(unsigned int exchange_value, 1.89 + volatile unsigned int* dest, 1.90 + unsigned int compare_value); 1.91 1.92 - static intptr_t cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value); 1.93 - static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value); 1.94 + inline static intptr_t cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value); 1.95 + inline static void* cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value); 1.96 }; 1.97 1.98 #endif // SHARE_VM_RUNTIME_ATOMIC_HPP