author | darcy |
Tue, 12 Nov 2019 10:45:23 -0800 | |
changeset 59037 | 3d2575331a41 |
parent 53244 | 9807daeb47c4 |
child 59247 | 56bf71d64d51 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50029
diff
changeset
|
2 |
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50029
diff
changeset
|
25 |
#ifndef OS_CPU_WINDOWS_X86_ATOMIC_WINDOWS_X86_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50029
diff
changeset
|
26 |
#define OS_CPU_WINDOWS_X86_ATOMIC_WINDOWS_X86_HPP |
7397 | 27 |
|
28 |
#include "runtime/os.hpp" |
|
29 |
||
1 | 30 |
// The following alternative implementations are needed because |
31 |
// Windows 95 doesn't support (some of) the corresponding Windows NT |
|
32 |
// calls. Furthermore, these versions allow inlining in the caller. |
|
33 |
// (More precisely: The documentation for InterlockedExchange says |
|
34 |
// it is supported for Windows 95. However, when single-stepping |
|
35 |
// through the assembly code we cannot step into the routine and |
|
36 |
// when looking at the routine address we see only garbage code. |
|
37 |
// Better safe then sorry!). Was bug 7/31/98 (gri). |
|
38 |
// |
|
39 |
// Performance note: On uniprocessors, the 'lock' prefixes are not |
|
40 |
// necessary (and expensive). We should generate separate cases if |
|
41 |
// this becomes a performance problem. |
|
42 |
||
43 |
#pragma warning(disable: 4035) // Disables warnings reporting missing return statement |
|
44 |
||
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
45 |
template<size_t byte_size> |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
46 |
struct Atomic::PlatformAdd |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
47 |
: Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
48 |
{ |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
49 |
template<typename I, typename D> |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
50 |
D add_and_fetch(I add_value, D volatile* dest, atomic_memory_order order) const; |
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
51 |
}; |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
52 |
|
1 | 53 |
#ifdef AMD64 |
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
54 |
template<> |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
55 |
template<typename I, typename D> |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
56 |
inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest, |
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
57 |
atomic_memory_order order) const { |
48468 | 58 |
return add_using_helper<int32_t>(os::atomic_add_func, add_value, dest); |
1 | 59 |
} |
60 |
||
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
61 |
template<> |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
62 |
template<typename I, typename D> |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
63 |
inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest, |
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
64 |
atomic_memory_order order) const { |
48468 | 65 |
return add_using_helper<int64_t>(os::atomic_add_long_func, add_value, dest); |
1 | 66 |
} |
67 |
||
47578
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
68 |
#define DEFINE_STUB_XCHG(ByteSize, StubType, StubName) \ |
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
69 |
template<> \ |
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
70 |
template<typename T> \ |
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
71 |
inline T Atomic::PlatformXchg<ByteSize>::operator()(T exchange_value, \ |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
72 |
T volatile* dest, \ |
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
73 |
atomic_memory_order order) const { \ |
47578
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
74 |
STATIC_ASSERT(ByteSize == sizeof(T)); \ |
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
75 |
return xchg_using_helper<StubType>(StubName, exchange_value, dest); \ |
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
76 |
} |
1 | 77 |
|
48468 | 78 |
DEFINE_STUB_XCHG(4, int32_t, os::atomic_xchg_func) |
79 |
DEFINE_STUB_XCHG(8, int64_t, os::atomic_xchg_long_func) |
|
1 | 80 |
|
47578
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
81 |
#undef DEFINE_STUB_XCHG |
1 | 82 |
|
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
83 |
#define DEFINE_STUB_CMPXCHG(ByteSize, StubType, StubName) \ |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
84 |
template<> \ |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
85 |
template<typename T> \ |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
86 |
inline T Atomic::PlatformCmpxchg<ByteSize>::operator()(T exchange_value, \ |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
87 |
T volatile* dest, \ |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
88 |
T compare_value, \ |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
89 |
atomic_memory_order order) const { \ |
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
90 |
STATIC_ASSERT(ByteSize == sizeof(T)); \ |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
91 |
return cmpxchg_using_helper<StubType>(StubName, exchange_value, dest, compare_value); \ |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
92 |
} |
27691
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
93 |
|
48468 | 94 |
DEFINE_STUB_CMPXCHG(1, int8_t, os::atomic_cmpxchg_byte_func) |
95 |
DEFINE_STUB_CMPXCHG(4, int32_t, os::atomic_cmpxchg_func) |
|
96 |
DEFINE_STUB_CMPXCHG(8, int64_t, os::atomic_cmpxchg_long_func) |
|
1 | 97 |
|
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
98 |
#undef DEFINE_STUB_CMPXCHG |
1 | 99 |
|
100 |
#else // !AMD64 |
|
101 |
||
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
102 |
template<> |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
103 |
template<typename I, typename D> |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
104 |
inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest, |
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
105 |
atomic_memory_order order) const { |
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
106 |
STATIC_ASSERT(4 == sizeof(I)); |
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46958
diff
changeset
|
107 |
STATIC_ASSERT(4 == sizeof(D)); |
1 | 108 |
__asm { |
109 |
mov edx, dest; |
|
110 |
mov eax, add_value; |
|
111 |
mov ecx, eax; |
|
46414 | 112 |
lock xadd dword ptr [edx], eax; |
1 | 113 |
add eax, ecx; |
114 |
} |
|
115 |
} |
|
116 |
||
47578
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
117 |
template<> |
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
118 |
template<typename T> |
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
119 |
inline T Atomic::PlatformXchg<4>::operator()(T exchange_value, |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
120 |
T volatile* dest, |
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
121 |
atomic_memory_order order) const { |
47578
09c41c4913d9
8187977: Generalize Atomic::xchg to use templates
eosterlund
parents:
47552
diff
changeset
|
122 |
STATIC_ASSERT(4 == sizeof(T)); |
1 | 123 |
// alternative for InterlockedExchange |
124 |
__asm { |
|
125 |
mov eax, exchange_value; |
|
126 |
mov ecx, dest; |
|
127 |
xchg eax, dword ptr [ecx]; |
|
128 |
} |
|
129 |
} |
|
130 |
||
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
131 |
template<> |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
132 |
template<typename T> |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
133 |
inline T Atomic::PlatformCmpxchg<1>::operator()(T exchange_value, |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
134 |
T volatile* dest, |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
135 |
T compare_value, |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
136 |
atomic_memory_order order) const { |
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
137 |
STATIC_ASSERT(1 == sizeof(T)); |
27691
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
138 |
// alternative for InterlockedCompareExchange |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
139 |
__asm { |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
140 |
mov edx, dest |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
141 |
mov cl, exchange_value |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
142 |
mov al, compare_value |
46414 | 143 |
lock cmpxchg byte ptr [edx], cl |
27691
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
144 |
} |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
145 |
} |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
25715
diff
changeset
|
146 |
|
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
147 |
template<> |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
148 |
template<typename T> |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
149 |
inline T Atomic::PlatformCmpxchg<4>::operator()(T exchange_value, |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
150 |
T volatile* dest, |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
151 |
T compare_value, |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
152 |
atomic_memory_order order) const { |
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
153 |
STATIC_ASSERT(4 == sizeof(T)); |
1 | 154 |
// alternative for InterlockedCompareExchange |
155 |
__asm { |
|
156 |
mov edx, dest |
|
157 |
mov ecx, exchange_value |
|
158 |
mov eax, compare_value |
|
46414 | 159 |
lock cmpxchg dword ptr [edx], ecx |
1 | 160 |
} |
161 |
} |
|
162 |
||
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
163 |
template<> |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
164 |
template<typename T> |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
165 |
inline T Atomic::PlatformCmpxchg<8>::operator()(T exchange_value, |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
166 |
T volatile* dest, |
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
167 |
T compare_value, |
50029
ea0a16ba6ac0
8202080: Introduce ordering semantics for Atomic::add and other RMW atomics
mdoerr
parents:
48468
diff
changeset
|
168 |
atomic_memory_order order) const { |
46958
a13bd8c6b7a2
8186166: Generalize Atomic::cmpxchg with templates
eosterlund
parents:
46523
diff
changeset
|
169 |
STATIC_ASSERT(8 == sizeof(T)); |
48468 | 170 |
int32_t ex_lo = (int32_t)exchange_value; |
171 |
int32_t ex_hi = *( ((int32_t*)&exchange_value) + 1 ); |
|
172 |
int32_t cmp_lo = (int32_t)compare_value; |
|
173 |
int32_t cmp_hi = *( ((int32_t*)&compare_value) + 1 ); |
|
1 | 174 |
__asm { |
175 |
push ebx |
|
176 |
push edi |
|
177 |
mov eax, cmp_lo |
|
178 |
mov edx, cmp_hi |
|
179 |
mov edi, dest |
|
180 |
mov ebx, ex_lo |
|
181 |
mov ecx, ex_hi |
|
46414 | 182 |
lock cmpxchg8b qword ptr [edi] |
1 | 183 |
pop edi |
184 |
pop ebx |
|
185 |
} |
|
186 |
} |
|
187 |
||
47593
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
188 |
template<> |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
189 |
template<typename T> |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
190 |
inline T Atomic::PlatformLoad<8>::operator()(T const volatile* src) const { |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
191 |
STATIC_ASSERT(8 == sizeof(T)); |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
192 |
volatile T dest; |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
193 |
volatile T* pdest = &dest; |
7885
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
194 |
__asm { |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
195 |
mov eax, src |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
196 |
fild qword ptr [eax] |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
197 |
mov eax, pdest |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
198 |
fistp qword ptr [eax] |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
199 |
} |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
200 |
return dest; |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
201 |
} |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
202 |
|
47593
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
203 |
template<> |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
204 |
template<typename T> |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
205 |
inline void Atomic::PlatformStore<8>::operator()(T store_value, |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
206 |
T volatile* dest) const { |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
207 |
STATIC_ASSERT(8 == sizeof(T)); |
2d56326b98f0
8188224: Generalize Atomic::load/store to use templates
eosterlund
parents:
47578
diff
changeset
|
208 |
volatile T* src = &store_value; |
7885
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
209 |
__asm { |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
210 |
mov eax, src |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
211 |
fild qword ptr [eax] |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
212 |
mov eax, dest |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
213 |
fistp qword ptr [eax] |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
214 |
} |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
215 |
} |
c02b05ba16a1
7009756: volatile variables could be broken throw reflection API
kvn
parents:
7397
diff
changeset
|
216 |
|
1 | 217 |
#endif // AMD64 |
218 |
||
219 |
#pragma warning(default: 4035) // Enables warnings reporting missing return statement |
|
7397 | 220 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
50029
diff
changeset
|
221 |
#endif // OS_CPU_WINDOWS_X86_ATOMIC_WINDOWS_X86_HPP |