Mercurial > hg > graal-compiler
comparison src/os_cpu/solaris_x86/vm/atomic_solaris_x86.inline.hpp @ 894:665be97e8704
6863420: os::javaTimeNanos() go backward on Solaris x86
Summary: Use new atomic long load method Atomic::load() to load max_hrtime.
Reviewed-by: never, ysr, johnc, phh, dcubed, acorn
author | kvn |
---|---|
date | Sun, 26 Jul 2009 16:40:14 -0700 |
parents | a61af66fc99e |
children | 89e0543e1737 |
comparison
equal
deleted
inserted
replaced
893:dd0a4e1e219b | 894:665be97e8704 |
---|---|
97 | 97 |
98 inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) { | 98 inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) { |
99 return (void*)_Atomic_cmpxchg_long((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value, (int) os::is_MP()); | 99 return (void*)_Atomic_cmpxchg_long((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value, (int) os::is_MP()); |
100 } | 100 } |
101 | 101 |
102 inline jlong Atomic::load(volatile jlong* src) { return *src; } | |
103 | |
102 #else // !AMD64 | 104 #else // !AMD64 |
103 | 105 |
104 inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) { | 106 inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) { |
105 return (intptr_t)add((jint)add_value, (volatile jint*)dest); | 107 return (intptr_t)add((jint)add_value, (volatile jint*)dest); |
106 } | 108 } |
129 } | 131 } |
130 | 132 |
131 inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) { | 133 inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value) { |
132 return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value); | 134 return (void*)cmpxchg((jint)exchange_value, (volatile jint*)dest, (jint)compare_value); |
133 } | 135 } |
136 | |
137 extern "C" void _Atomic_load_long(volatile jlong* src, volatile jlong* dst); | |
138 | |
139 inline jlong Atomic::load(volatile jlong* src) { | |
140 volatile jlong dest; | |
141 _Atomic_load_long(src, &dest); | |
142 return dest; | |
143 } | |
144 | |
134 #endif // AMD64 | 145 #endif // AMD64 |
135 | 146 |
136 #ifdef _GNU_SOURCE | 147 #ifdef _GNU_SOURCE |
137 // Add a lock prefix to an instruction on an MP machine | 148 // Add a lock prefix to an instruction on an MP machine |
138 #define LOCK_IF_MP(mp) "cmp $0, " #mp "; je 1f; lock; 1: " | 149 #define LOCK_IF_MP(mp) "cmp $0, " #mp "; je 1f; lock; 1: " |