OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 | 5 |
6 // This file is an internal atomic implementation for compiler-based | 6 // This file is an internal atomic implementation for compiler-based |
7 // ThreadSanitizer. Use base/atomicops.h instead. | 7 // ThreadSanitizer. Use base/atomicops.h instead. |
8 | 8 |
9 #ifndef V8_ATOMICOPS_INTERNALS_TSAN_H_ | 9 #ifndef V8_BASE_ATOMICOPS_INTERNALS_TSAN_H_ |
10 #define V8_ATOMICOPS_INTERNALS_TSAN_H_ | 10 #define V8_BASE_ATOMICOPS_INTERNALS_TSAN_H_ |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace base { |
14 | 14 |
15 #ifndef TSAN_INTERFACE_ATOMIC_H | 15 #ifndef TSAN_INTERFACE_ATOMIC_H |
16 #define TSAN_INTERFACE_ATOMIC_H | 16 #define TSAN_INTERFACE_ATOMIC_H |
17 | 17 |
18 // This struct is not part of the public API of this module; clients may not | 18 // This struct is not part of the public API of this module; clients may not |
19 // use it. (However, it's exported via BASE_EXPORT because clients implicitly | 19 // use it. (However, it's exported via BASE_EXPORT because clients implicitly |
20 // do use it at link time by inlining these functions.) | 20 // do use it at link time by inlining these functions.) |
21 // Features of this x86. Values may not be correct before main() is run, | 21 // Features of this x86. Values may not be correct before main() is run, |
22 // but are set conservatively. | 22 // but are set conservatively. |
23 struct AtomicOps_x86CPUFeatureStruct { | 23 struct AtomicOps_x86CPUFeatureStruct { |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 Atomic64 cmp = old_value; | 364 Atomic64 cmp = old_value; |
365 __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value, | 365 __tsan_atomic64_compare_exchange_strong(ptr, &cmp, new_value, |
366 __tsan_memory_order_release, __tsan_memory_order_relaxed); | 366 __tsan_memory_order_release, __tsan_memory_order_relaxed); |
367 return cmp; | 367 return cmp; |
368 } | 368 } |
369 | 369 |
370 inline void MemoryBarrier() { | 370 inline void MemoryBarrier() { |
371 __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst); | 371 __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst); |
372 } | 372 } |
373 | 373 |
374 } // namespace internal | 374 } // namespace base |
375 } // namespace v8 | 375 } // namespace v8 |
376 | 376 |
377 #undef ATOMICOPS_COMPILER_BARRIER | 377 #undef ATOMICOPS_COMPILER_BARRIER |
378 | 378 |
379 #endif // V8_ATOMICOPS_INTERNALS_TSAN_H_ | 379 #endif // V8_BASE_ATOMICOPS_INTERNALS_TSAN_H_ |
OLD | NEW |