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

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
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)
« no previous file with comments | « runtime/CPPLINT.cfg ('k') | runtime/vm/atomic_android.h » ('j') | runtime/vm/atomic_simulator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698