| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 Atomic32 new_value) { | 93 Atomic32 new_value) { |
| 94 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); | 94 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); |
| 95 } | 95 } |
| 96 | 96 |
| 97 inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, | 97 inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, |
| 98 Atomic32 old_value, | 98 Atomic32 old_value, |
| 99 Atomic32 new_value) { | 99 Atomic32 new_value) { |
| 100 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); | 100 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); |
| 101 } | 101 } |
| 102 | 102 |
| 103 inline void NoBarrier_Store(volatile Atomic8* ptr, Atomic8 value) { |
| 104 *ptr = value; |
| 105 } |
| 106 |
| 103 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { | 107 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { |
| 104 *ptr = value; | 108 *ptr = value; |
| 105 } | 109 } |
| 106 | 110 |
| 107 inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { | 111 inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { |
| 108 NoBarrier_AtomicExchange(ptr, value); | 112 NoBarrier_AtomicExchange(ptr, value); |
| 109 // acts as a barrier in this implementation | 113 // acts as a barrier in this implementation |
| 110 } | 114 } |
| 111 | 115 |
| 112 inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { | 116 inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { |
| 113 *ptr = value; // works w/o barrier for current Intel chips as of June 2005 | 117 *ptr = value; // works w/o barrier for current Intel chips as of June 2005 |
| 114 // See comments in Atomic64 version of Release_Store() below. | 118 // See comments in Atomic64 version of Release_Store() below. |
| 115 } | 119 } |
| 116 | 120 |
| 121 inline Atomic8 NoBarrier_Load(volatile const Atomic8* ptr) { |
| 122 return *ptr; |
| 123 } |
| 124 |
| 117 inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { | 125 inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { |
| 118 return *ptr; | 126 return *ptr; |
| 119 } | 127 } |
| 120 | 128 |
| 121 inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { | 129 inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { |
| 122 Atomic32 value = *ptr; | 130 Atomic32 value = *ptr; |
| 123 return value; | 131 return value; |
| 124 } | 132 } |
| 125 | 133 |
| 126 inline Atomic32 Release_Load(volatile const Atomic32* ptr) { | 134 inline Atomic32 Release_Load(volatile const Atomic32* ptr) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 Atomic64 new_value) { | 216 Atomic64 new_value) { |
| 209 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); | 217 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); |
| 210 } | 218 } |
| 211 | 219 |
| 212 | 220 |
| 213 #endif // defined(_WIN64) | 221 #endif // defined(_WIN64) |
| 214 | 222 |
| 215 } } // namespace v8::internal | 223 } } // namespace v8::internal |
| 216 | 224 |
| 217 #endif // V8_ATOMICOPS_INTERNALS_X86_MSVC_H_ | 225 #endif // V8_ATOMICOPS_INTERNALS_X86_MSVC_H_ |
| OLD | NEW |