summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2013-02-25 23:03:23 +0100
committerGabor Greif <ggreif@gmail.com>2013-02-26 10:30:35 +0100
commitb7ae3cd9273da044384de4a327a4a5d71190129e (patch)
treefb18f2ccbf97eeedb6419ec9d342670db596a56f
parent20b98f350d7b30118ca311117903fc039f6b85ce (diff)
downloadhaskell-b7ae3cd9273da044384de4a327a4a5d71190129e.tar.gz
Only emit %write_barrier primitive for THREADED_RTS
-rw-r--r--includes/Cmm.h8
-rw-r--r--includes/rts/storage/SMPClosureOps.h4
-rw-r--r--rts/Updates.h4
3 files changed, 11 insertions, 5 deletions
diff --git a/includes/Cmm.h b/includes/Cmm.h
index 1505b1cb6a..ca8e51af78 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -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
@@ -583,6 +583,12 @@
#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
-------------------------------------------------------------------------- */
diff --git a/includes/rts/storage/SMPClosureOps.h b/includes/rts/storage/SMPClosureOps.h
index cd6a789af4..39349874f7 100644
--- a/includes/rts/storage/SMPClosureOps.h
+++ b/includes/rts/storage/SMPClosureOps.h
@@ -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
diff --git a/rts/Updates.h b/rts/Updates.h
index b4ff7d131b..1bd742a746 100644
--- a/rts/Updates.h
+++ b/rts/Updates.h
@@ -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); \