Index: runtime/vm/atomic.h |
=================================================================== |
--- runtime/vm/atomic.h (revision 41298) |
+++ runtime/vm/atomic.h (working copy) |
@@ -8,6 +8,7 @@ |
#include "platform/globals.h" |
#include "vm/allocation.h" |
+#include "vm/simulator.h" |
namespace dart { |
@@ -15,6 +16,8 @@ |
public: |
// Atomically fetch the value at p and increment the value at p. |
// Returns the original value at p. |
+ // |
+ // NOTE: Not to be used for any atomic operations involving generated code. |
koda
2014/10/27 14:05:10
This is a bit vague. "involving memory locations t
Ivan Posva
2014/10/27 17:58:23
Done.
|
static uintptr_t FetchAndIncrement(uintptr_t* p); |
static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value); |
@@ -23,6 +26,10 @@ |
} // namespace dart |
+// We need to use the simulator to ensure that atomic operations are observed |
+// both in C++ and in generated code if the simulator is active. |
+#include "vm/atomic_simulator.h" |
+ |
#if defined(TARGET_OS_ANDROID) |
#include "vm/atomic_android.h" |
#elif defined(TARGET_OS_LINUX) |