30 #ifndef V8_ATOMICOPS_INTERNALS_X86_MSVC_H_
31 #define V8_ATOMICOPS_INTERNALS_X86_MSVC_H_
36 #if defined(V8_HOST_ARCH_64_BIT)
51 LONG result = InterlockedCompareExchange(
52 reinterpret_cast<volatile LONG*>(ptr),
53 static_cast<LONG>(new_value),
54 static_cast<LONG>(old_value));
55 return static_cast<Atomic32>(result);
60 LONG result = InterlockedExchange(
61 reinterpret_cast<volatile LONG*>(ptr),
62 static_cast<LONG>(new_value));
63 return static_cast<Atomic32>(result);
68 return InterlockedExchangeAdd(
69 reinterpret_cast<volatile LONG*>(ptr),
70 static_cast<LONG>(increment)) + increment;
78 #if !(defined(_MSC_VER) && _MSC_VER >= 1400)
79 #error "We require at least vs2005 for MemoryBarrier"
82 #if defined(V8_HOST_ARCH_64_BIT)
139 Atomic64 new_value) {
140 PVOID result = InterlockedCompareExchangePointer(
141 reinterpret_cast<volatile PVOID*>(ptr),
142 reinterpret_cast<PVOID>(new_value), reinterpret_cast<PVOID>(old_value));
143 return reinterpret_cast<Atomic64
>(result);
147 Atomic64 new_value) {
148 PVOID result = InterlockedExchangePointer(
149 reinterpret_cast<volatile PVOID*>(ptr),
150 reinterpret_cast<PVOID>(new_value));
151 return reinterpret_cast<Atomic64
>(result);
155 Atomic64 increment) {
156 return InterlockedExchangeAdd64(
157 reinterpret_cast<volatile LONGLONG*>(ptr),
158 static_cast<LONGLONG>(increment)) + increment;
162 Atomic64 increment) {
170 inline void Acquire_Store(
volatile Atomic64* ptr, Atomic64 value) {
175 inline void Release_Store(
volatile Atomic64* ptr, Atomic64 value) {
190 inline Atomic64
Acquire_Load(
volatile const Atomic64* ptr) {
191 Atomic64 value = *ptr;
195 inline Atomic64
Release_Load(
volatile const Atomic64* ptr) {
202 Atomic64 new_value) {
208 Atomic64 new_value) {
213 #endif // defined(_WIN64)
217 #endif // V8_ATOMICOPS_INTERNALS_X86_MSVC_H_
void Acquire_Store(volatile Atomic32 *ptr, Atomic32 value)
typedef PVOID(__stdcall *DLL_FUNC_TYPE(SymFunctionTableAccess64))(HANDLE hProcess
Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
Atomic32 Release_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
void NoBarrier_Store(volatile Atomic32 *ptr, Atomic32 value)
Atomic32 NoBarrier_AtomicExchange(volatile Atomic32 *ptr, Atomic32 new_value)
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
Atomic32 Release_Load(volatile const Atomic32 *ptr)
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr, Atomic32 increment)
void Release_Store(volatile Atomic32 *ptr, Atomic32 value)
Atomic32 Barrier_AtomicIncrement(volatile Atomic32 *ptr, Atomic32 increment)
Atomic32 NoBarrier_Load(volatile const Atomic32 *ptr)
Atomic32 Acquire_Load(volatile const Atomic32 *ptr)
Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)