Only emit %write_barrier primitive for THREADED_RTS
authorGabor Greif <ggreif@gmail.com>
Mon, 25 Feb 2013 22:03:23 +0000 (23:03 +0100)
committerGabor Greif <ggreif@gmail.com>
Tue, 26 Feb 2013 09:30:35 +0000 (10:30 +0100)
includes/Cmm.h
includes/rts/storage/SMPClosureOps.h
rts/Updates.h

index 1505b1c..ca8e51a 100644 (file)
@@ -1,6 +1,6 @@
 /* -----------------------------------------------------------------------------
  *
- * (c) The University of Glasgow 2004-2012
+ * (c) The University of Glasgow 2004-2013
  *
  * This file is included at the top of all .cmm source files (and
  * *only* .cmm files).  It defines a collection of useful macros for
 #define OVERWRITING_CLOSURE(c) /* nothing */
 #endif
 
+#ifdef THREADED_RTS
+#define prim_write_barrier prim %write_barrier()
+#else
+#define prim_write_barrier /* nothing */
+#endif
+
 /* -----------------------------------------------------------------------------
    Ticky macros 
    -------------------------------------------------------------------------- */
index cd6a789..3934987 100644 (file)
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  *
- * (c) The GHC Team, 2005
+ * (c) The GHC Team, 2005-2013
  *
  * Macros for THREADED_RTS support
  *
@@ -12,7 +12,7 @@
 #ifdef CMINUSMINUS
 
 #define unlockClosure(ptr,info)                 \
-    prim %write_barrier();                      \
+    prim_write_barrier;                         \
     StgHeader_info(ptr) = info;    
 
 #else
index b4ff7d1..1bd742a 100644 (file)
@@ -1,6 +1,6 @@
 /* -----------------------------------------------------------------------------
  *
- * (c) The GHC Team, 1998-2004
+ * (c) The GHC Team, 1998-2013
  *
  * Performing updates.
  *
@@ -46,7 +46,7 @@
                                                                \
     OVERWRITING_CLOSURE(p1);                                    \
     StgInd_indirectee(p1) = p2;                                 \
-    prim %write_barrier();                                      \
+    prim_write_barrier;                                         \
     SET_INFO(p1, stg_BLACKHOLE_info);                           \
     LDV_RECORD_CREATE(p1);                                      \
     bd = Bdescr(p1);                                           \