| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } while (prev_value == old_value); | 86 } while (prev_value == old_value); |
| 87 return prev_value; | 87 return prev_value; |
| 88 } | 88 } |
| 89 | 89 |
| 90 inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, | 90 inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, |
| 91 Atomic32 old_value, | 91 Atomic32 old_value, |
| 92 Atomic32 new_value) { | 92 Atomic32 new_value) { |
| 93 return Acquire_CompareAndSwap(ptr, old_value, new_value); | 93 return Acquire_CompareAndSwap(ptr, old_value, new_value); |
| 94 } | 94 } |
| 95 | 95 |
| 96 inline void NoBarrier_Store(volatile Atomic8* ptr, Atomic8 value) { |
| 97 *ptr = value; |
| 98 } |
| 99 |
| 96 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { | 100 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { |
| 97 *ptr = value; | 101 *ptr = value; |
| 98 } | 102 } |
| 99 | 103 |
| 100 inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { | 104 inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { |
| 101 *ptr = value; | 105 *ptr = value; |
| 102 MemoryBarrier(); | 106 MemoryBarrier(); |
| 103 } | 107 } |
| 104 | 108 |
| 105 inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { | 109 inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { |
| 106 MemoryBarrier(); | 110 MemoryBarrier(); |
| 107 *ptr = value; | 111 *ptr = value; |
| 108 } | 112 } |
| 109 | 113 |
| 114 inline Atomic8 NoBarrier_Load(volatile const Atomic8* ptr) { |
| 115 return *ptr; |
| 116 } |
| 117 |
| 110 inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { | 118 inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { |
| 111 return *ptr; | 119 return *ptr; |
| 112 } | 120 } |
| 113 | 121 |
| 114 inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { | 122 inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { |
| 115 Atomic32 value = *ptr; | 123 Atomic32 value = *ptr; |
| 116 MemoryBarrier(); | 124 MemoryBarrier(); |
| 117 return value; | 125 return value; |
| 118 } | 126 } |
| 119 | 127 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 inline Atomic64 Release_Load(volatile const Atomic64* ptr) { | 218 inline Atomic64 Release_Load(volatile const Atomic64* ptr) { |
| 211 MemoryBarrier(); | 219 MemoryBarrier(); |
| 212 return *ptr; | 220 return *ptr; |
| 213 } | 221 } |
| 214 | 222 |
| 215 #endif // defined(__LP64__) | 223 #endif // defined(__LP64__) |
| 216 | 224 |
| 217 } } // namespace v8::internal | 225 } } // namespace v8::internal |
| 218 | 226 |
| 219 #endif // V8_ATOMICOPS_INTERNALS_MAC_H_ | 227 #endif // V8_ATOMICOPS_INTERNALS_MAC_H_ |
| OLD | NEW |