OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 Atomic32 old_value, | 137 Atomic32 old_value, |
138 Atomic32 new_value) { | 138 Atomic32 new_value) { |
139 Atomic32 prev; | 139 Atomic32 prev; |
140 | 140 |
141 MemoryBarrier(); | 141 MemoryBarrier(); |
142 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value); | 142 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value); |
143 | 143 |
144 return prev; | 144 return prev; |
145 } | 145 } |
146 | 146 |
| 147 inline void NoBarrier_Store(volatile Atomic8* ptr, Atomic8 value) { |
| 148 *ptr = value; |
| 149 } |
| 150 |
147 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { | 151 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { |
148 *ptr = value; | 152 *ptr = value; |
149 } | 153 } |
150 | 154 |
151 inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { | 155 inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { |
152 *ptr = value; | 156 *ptr = value; |
153 MemoryBarrier(); | 157 MemoryBarrier(); |
154 } | 158 } |
155 | 159 |
156 inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { | 160 inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { |
157 __asm__ __volatile__ ( // NOLINT | 161 __asm__ __volatile__ ( // NOLINT |
158 "stlr %w[value], %[ptr] \n\t" | 162 "stlr %w[value], %[ptr] \n\t" |
159 : [ptr]"=Q" (*ptr) | 163 : [ptr]"=Q" (*ptr) |
160 : [value]"r" (value) | 164 : [value]"r" (value) |
161 : "memory" | 165 : "memory" |
162 ); // NOLINT | 166 ); // NOLINT |
163 } | 167 } |
164 | 168 |
| 169 inline Atomic8 NoBarrier_Load(volatile const Atomic8* ptr) { |
| 170 return *ptr; |
| 171 } |
| 172 |
165 inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { | 173 inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { |
166 return *ptr; | 174 return *ptr; |
167 } | 175 } |
168 | 176 |
169 inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { | 177 inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { |
170 Atomic32 value; | 178 Atomic32 value; |
171 | 179 |
172 __asm__ __volatile__ ( // NOLINT | 180 __asm__ __volatile__ ( // NOLINT |
173 "ldar %w[value], %[ptr] \n\t" | 181 "ldar %w[value], %[ptr] \n\t" |
174 : [value]"=r" (value) | 182 : [value]"=r" (value) |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 330 } |
323 | 331 |
324 inline Atomic64 Release_Load(volatile const Atomic64* ptr) { | 332 inline Atomic64 Release_Load(volatile const Atomic64* ptr) { |
325 MemoryBarrier(); | 333 MemoryBarrier(); |
326 return *ptr; | 334 return *ptr; |
327 } | 335 } |
328 | 336 |
329 } } // namespace v8::internal | 337 } } // namespace v8::internal |
330 | 338 |
331 #endif // V8_ATOMICOPS_INTERNALS_ARM_GCC_H_ | 339 #endif // V8_ATOMICOPS_INTERNALS_ARM_GCC_H_ |
OLD | NEW |