From b7ae3cd9273da044384de4a327a4a5d71190129e Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Mon, 25 Feb 2013 23:03:23 +0100 Subject: Only emit %write_barrier primitive for THREADED_RTS --- includes/Cmm.h | 8 +++++++- includes/rts/storage/SMPClosureOps.h | 4 ++-- rts/Updates.h | 4 ++-- 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); \ -- cgit v1.2.1