OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef VM_ATOMIC_H_ | 5 #ifndef VM_ATOMIC_H_ |
6 #define VM_ATOMIC_H_ | 6 #define VM_ATOMIC_H_ |
7 | 7 |
8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
9 | 9 |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // Performs a load of a word from 'ptr', but without any guarantees about | 58 // Performs a load of a word from 'ptr', but without any guarantees about |
59 // memory order (i.e., no load barriers/fences). | 59 // memory order (i.e., no load barriers/fences). |
60 static intptr_t LoadRelaxedIntPtr(intptr_t* ptr) { | 60 static intptr_t LoadRelaxedIntPtr(intptr_t* ptr) { |
61 return *static_cast<volatile intptr_t*>(ptr); | 61 return *static_cast<volatile intptr_t*>(ptr); |
62 } | 62 } |
63 }; | 63 }; |
64 | 64 |
65 | 65 |
66 } // namespace dart | 66 } // namespace dart |
67 | 67 |
| 68 #if defined(USING_SIMULATOR) && !defined(TARGET_ARCH_DBC) |
| 69 #define USING_SIMULATOR_ATOMICS |
| 70 #endif |
| 71 |
| 72 #if defined(USING_SIMULATOR_ATOMICS) |
68 // We need to use the simulator to ensure that atomic operations are observed | 73 // We need to use the simulator to ensure that atomic operations are observed |
69 // both in C++ and in generated code if the simulator is active. | 74 // both in C++ and in generated code if the simulator is active. |
70 #include "vm/atomic_simulator.h" | 75 #include "vm/atomic_simulator.h" |
| 76 #endif |
71 | 77 |
72 #if defined(TARGET_OS_ANDROID) | 78 #if defined(TARGET_OS_ANDROID) |
73 #include "vm/atomic_android.h" | 79 #include "vm/atomic_android.h" |
74 #elif defined(TARGET_OS_LINUX) | 80 #elif defined(TARGET_OS_LINUX) |
75 #include "vm/atomic_linux.h" | 81 #include "vm/atomic_linux.h" |
76 #elif defined(TARGET_OS_MACOS) | 82 #elif defined(TARGET_OS_MACOS) |
77 #include "vm/atomic_macos.h" | 83 #include "vm/atomic_macos.h" |
78 #elif defined(TARGET_OS_WINDOWS) | 84 #elif defined(TARGET_OS_WINDOWS) |
79 #include "vm/atomic_win.h" | 85 #include "vm/atomic_win.h" |
80 #else | 86 #else |
81 #error Unknown target os. | 87 #error Unknown target os. |
82 #endif | 88 #endif |
83 | 89 |
84 #endif // VM_ATOMIC_H_ | 90 #endif // VM_ATOMIC_H_ |
OLD | NEW |