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

Unified Diff: runtime/vm/atomic.h

Issue 677193002: - Use the simulator to do atomic operations that could also (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/CPPLINT.cfg ('k') | runtime/vm/atomic_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/atomic.h
===================================================================
--- runtime/vm/atomic.h (revision 41327)
+++ 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,9 @@
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 memory locations
+ // that are accessed by generated code
static uintptr_t FetchAndIncrement(uintptr_t* p);
static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value);
@@ -23,6 +27,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)
« no previous file with comments | « runtime/CPPLINT.cfg ('k') | runtime/vm/atomic_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698