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

Side by Side Diff: runtime/vm/atomic.h

Issue 1834763004: Track loading happening in parallel with background compilation and abort compilation if necessary. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: comments Created 4 years, 8 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
« no previous file with comments | « no previous file | runtime/vm/compiler.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 (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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // NOTE: OK to use with memory locations that are accessed by generated code 46 // NOTE: OK to use with memory locations that are accessed by generated code
47 static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value); 47 static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value);
48 static uint32_t CompareAndSwapUint32( 48 static uint32_t CompareAndSwapUint32(
49 uint32_t* ptr, uint32_t old_value, uint32_t new_value); 49 uint32_t* ptr, uint32_t old_value, uint32_t new_value);
50 50
51 // Performs a load of a word from 'ptr', but without any guarantees about 51 // Performs a load of a word from 'ptr', but without any guarantees about
52 // memory order (i.e., no load barriers/fences). 52 // memory order (i.e., no load barriers/fences).
53 static uword LoadRelaxed(uword* ptr) { 53 static uword LoadRelaxed(uword* ptr) {
54 return *static_cast<volatile uword*>(ptr); 54 return *static_cast<volatile uword*>(ptr);
55 } 55 }
56
57 // Performs a load of a word from 'ptr', but without any guarantees about
58 // memory order (i.e., no load barriers/fences).
59 static intptr_t LoadRelaxedIntPtr(intptr_t* ptr) {
60 return *static_cast<volatile intptr_t*>(ptr);
61 }
56 }; 62 };
57 63
58 64
59 } // namespace dart 65 } // namespace dart
60 66
61 // We need to use the simulator to ensure that atomic operations are observed 67 // We need to use the simulator to ensure that atomic operations are observed
62 // both in C++ and in generated code if the simulator is active. 68 // both in C++ and in generated code if the simulator is active.
63 #include "vm/atomic_simulator.h" 69 #include "vm/atomic_simulator.h"
64 70
65 #if defined(TARGET_OS_ANDROID) 71 #if defined(TARGET_OS_ANDROID)
66 #include "vm/atomic_android.h" 72 #include "vm/atomic_android.h"
67 #elif defined(TARGET_OS_LINUX) 73 #elif defined(TARGET_OS_LINUX)
68 #include "vm/atomic_linux.h" 74 #include "vm/atomic_linux.h"
69 #elif defined(TARGET_OS_MACOS) 75 #elif defined(TARGET_OS_MACOS)
70 #include "vm/atomic_macos.h" 76 #include "vm/atomic_macos.h"
71 #elif defined(TARGET_OS_WINDOWS) 77 #elif defined(TARGET_OS_WINDOWS)
72 #include "vm/atomic_win.h" 78 #include "vm/atomic_win.h"
73 #else 79 #else
74 #error Unknown target os. 80 #error Unknown target os.
75 #endif 81 #endif
76 82
77 #endif // VM_ATOMIC_H_ 83 #endif // VM_ATOMIC_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698