Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: src/atomicops.h

Issue 304153016: Use full include paths everywhere (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.cc ('k') | src/atomicops_internals_x86_gcc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 // The routines exported by this module are subtle. If you use them, even if 5 // The routines exported by this module are subtle. If you use them, even if
6 // you get the code right, it will depend on careful reasoning about atomicity 6 // you get the code right, it will depend on careful reasoning about atomicity
7 // and memory ordering; it will be less readable, and harder to maintain. If 7 // and memory ordering; it will be less readable, and harder to maintain. If
8 // you plan to use these routines, you should have a good reason, such as solid 8 // you plan to use these routines, you should have a good reason, such as solid
9 // evidence that performance would otherwise suffer, or there being no 9 // evidence that performance would otherwise suffer, or there being no
10 // alternative. You should assume only properties explicitly guaranteed by the 10 // alternative. You should assume only properties explicitly guaranteed by the
11 // specifications in this file. You are almost certainly _not_ writing code 11 // specifications in this file. You are almost certainly _not_ writing code
12 // just for the x86; if you assume x86 semantics, x86 hardware bugs and 12 // just for the x86; if you assume x86 semantics, x86 hardware bugs and
13 // implementations on other archtectures will cause your code to break. If you 13 // implementations on other archtectures will cause your code to break. If you
14 // do not know what you are doing, avoid these routines, and use a Mutex. 14 // do not know what you are doing, avoid these routines, and use a Mutex.
15 // 15 //
16 // It is incorrect to make direct assignments to/from an atomic variable. 16 // It is incorrect to make direct assignments to/from an atomic variable.
17 // You should use one of the Load or Store routines. The NoBarrier 17 // You should use one of the Load or Store routines. The NoBarrier
18 // versions are provided when no barriers are needed: 18 // versions are provided when no barriers are needed:
19 // NoBarrier_Store() 19 // NoBarrier_Store()
20 // NoBarrier_Load() 20 // NoBarrier_Load()
21 // Although there are currently no compiler enforcement, you are encouraged 21 // Although there are currently no compiler enforcement, you are encouraged
22 // to use these. 22 // to use these.
23 // 23 //
24 24
25 #ifndef V8_ATOMICOPS_H_ 25 #ifndef V8_ATOMICOPS_H_
26 #define V8_ATOMICOPS_H_ 26 #define V8_ATOMICOPS_H_
27 27
28 #include "../include/v8.h" 28 #include "include/v8.h"
29 #include "base/build_config.h" 29 #include "src/base/build_config.h"
30 30
31 #if defined(_WIN32) && defined(V8_HOST_ARCH_64_BIT) 31 #if defined(_WIN32) && defined(V8_HOST_ARCH_64_BIT)
32 // windows.h #defines this (only on x64). This causes problems because the 32 // windows.h #defines this (only on x64). This causes problems because the
33 // public API also uses MemoryBarrier at the public name for this fence. So, on 33 // public API also uses MemoryBarrier at the public name for this fence. So, on
34 // X64, undef it, and call its documented 34 // X64, undef it, and call its documented
35 // (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) 35 // (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx)
36 // implementation directly. 36 // implementation directly.
37 #undef MemoryBarrier 37 #undef MemoryBarrier
38 #endif 38 #endif
39 39
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void Release_Store(volatile Atomic64* ptr, Atomic64 value); 128 void Release_Store(volatile Atomic64* ptr, Atomic64 value);
129 Atomic64 NoBarrier_Load(volatile const Atomic64* ptr); 129 Atomic64 NoBarrier_Load(volatile const Atomic64* ptr);
130 Atomic64 Acquire_Load(volatile const Atomic64* ptr); 130 Atomic64 Acquire_Load(volatile const Atomic64* ptr);
131 Atomic64 Release_Load(volatile const Atomic64* ptr); 131 Atomic64 Release_Load(volatile const Atomic64* ptr);
132 #endif // V8_HOST_ARCH_64_BIT 132 #endif // V8_HOST_ARCH_64_BIT
133 133
134 } } // namespace v8::internal 134 } } // namespace v8::internal
135 135
136 // Include our platform specific implementation. 136 // Include our platform specific implementation.
137 #if defined(THREAD_SANITIZER) 137 #if defined(THREAD_SANITIZER)
138 #include "atomicops_internals_tsan.h" 138 #include "src/atomicops_internals_tsan.h"
139 #elif defined(_MSC_VER) && (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64) 139 #elif defined(_MSC_VER) && (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64)
140 #include "atomicops_internals_x86_msvc.h" 140 #include "src/atomicops_internals_x86_msvc.h"
141 #elif defined(__APPLE__) 141 #elif defined(__APPLE__)
142 #include "atomicops_internals_mac.h" 142 #include "src/atomicops_internals_mac.h"
143 #elif defined(__GNUC__) && V8_HOST_ARCH_ARM64 143 #elif defined(__GNUC__) && V8_HOST_ARCH_ARM64
144 #include "atomicops_internals_arm64_gcc.h" 144 #include "src/atomicops_internals_arm64_gcc.h"
145 #elif defined(__GNUC__) && V8_HOST_ARCH_ARM 145 #elif defined(__GNUC__) && V8_HOST_ARCH_ARM
146 #include "atomicops_internals_arm_gcc.h" 146 #include "src/atomicops_internals_arm_gcc.h"
147 #elif defined(__GNUC__) && (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64) 147 #elif defined(__GNUC__) && (V8_HOST_ARCH_IA32 || V8_HOST_ARCH_X64)
148 #include "atomicops_internals_x86_gcc.h" 148 #include "src/atomicops_internals_x86_gcc.h"
149 #elif defined(__GNUC__) && V8_HOST_ARCH_MIPS 149 #elif defined(__GNUC__) && V8_HOST_ARCH_MIPS
150 #include "atomicops_internals_mips_gcc.h" 150 #include "src/atomicops_internals_mips_gcc.h"
151 #else 151 #else
152 #error "Atomic operations are not supported on your platform" 152 #error "Atomic operations are not supported on your platform"
153 #endif 153 #endif
154 154
155 // On some platforms we need additional declarations to make 155 // On some platforms we need additional declarations to make
156 // AtomicWord compatible with our other Atomic* types. 156 // AtomicWord compatible with our other Atomic* types.
157 #if defined(__APPLE__) || defined(__OpenBSD__) 157 #if defined(__APPLE__) || defined(__OpenBSD__)
158 #include "atomicops_internals_atomicword_compat.h" 158 #include "src/atomicops_internals_atomicword_compat.h"
159 #endif 159 #endif
160 160
161 #endif // V8_ATOMICOPS_H_ 161 #endif // V8_ATOMICOPS_H_
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/atomicops_internals_x86_gcc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698