From 608bc3f3ad6fca14a23529f314dbd9d3342a9507 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 9 Feb 2006 15:04:20 +0000 Subject: [PATCH] change dirty_MUT_VAR() to use recordMutableCap() rather than recordMutableGen(), the former works better in SMP --- ghc/compiler/codeGen/CgPrimOp.hs | 3 ++- ghc/includes/RtsExternal.h | 2 +- ghc/includes/Storage.h | 2 +- ghc/rts/PrimOps.cmm | 2 +- ghc/rts/Storage.c | 5 +++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/codeGen/CgPrimOp.hs b/ghc/compiler/codeGen/CgPrimOp.hs index 7de4516..c1264be 100644 --- a/ghc/compiler/codeGen/CgPrimOp.hs +++ b/ghc/compiler/codeGen/CgPrimOp.hs @@ -134,7 +134,8 @@ emitPrimOp [] WriteMutVarOp [mutv,var] live stmtC (CmmCall (CmmForeignCall (CmmLit (CmmLabel mkDirty_MUT_VAR_Label)) CCallConv) [{-no results-}] - [(mutv,PtrHint)] + [(CmmReg (CmmGlobal BaseReg), PtrHint), + (mutv,PtrHint)] (Just vols)) -- #define sizzeofByteArrayzh(r,a) \ diff --git a/ghc/includes/RtsExternal.h b/ghc/includes/RtsExternal.h index c5f5043..61a920b 100644 --- a/ghc/includes/RtsExternal.h +++ b/ghc/includes/RtsExternal.h @@ -91,6 +91,6 @@ extern void performMajorGC(void); extern void performGCWithRoots(void (*get_roots)(evac_fn)); extern HsInt64 getAllocations( void ); extern void revertCAFs( void ); -extern void dirty_MUT_VAR(StgClosure *); +extern void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); #endif /* RTSEXTERNAL_H */ diff --git a/ghc/includes/Storage.h b/ghc/includes/Storage.h index c339c4e..8709f18 100644 --- a/ghc/includes/Storage.h +++ b/ghc/includes/Storage.h @@ -269,7 +269,7 @@ extern rtsBool keepCAFs; and is put on the mutable list. -------------------------------------------------------------------------- */ -void dirty_MUT_VAR(StgClosure *p); +void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); /* ----------------------------------------------------------------------------- DEBUGGING predicates for pointers diff --git a/ghc/rts/PrimOps.cmm b/ghc/rts/PrimOps.cmm index 58948da..049e4e2 100644 --- a/ghc/rts/PrimOps.cmm +++ b/ghc/rts/PrimOps.cmm @@ -228,7 +228,7 @@ atomicModifyMutVarzh_fast StgThunk_payload(y,0) = z; StgMutVar_var(R1) = y; - foreign "C" dirty_MUT_VAR(R1 "ptr") [R1]; + foreign "C" dirty_MUT_VAR(BaseReg "ptr", R1 "ptr") [R1]; TICK_ALLOC_THUNK_1(); CCCS_ALLOC(THUNK_1_SIZE); diff --git a/ghc/rts/Storage.c b/ghc/rts/Storage.c index 28ccf79..5868730 100644 --- a/ghc/rts/Storage.c +++ b/ghc/rts/Storage.c @@ -766,11 +766,12 @@ allocatePinned( nat n ) -------------------------------------------------------------------------- */ void -dirty_MUT_VAR(StgClosure *p) +dirty_MUT_VAR(StgRegTable *reg, StgClosure *p) { + Capability *cap = regTableToCapability(reg); if (p->header.info == &stg_MUT_VAR_CLEAN_info) { p->header.info = &stg_MUT_VAR_DIRTY_info; - recordMutable(p); + recordMutableCap(p,cap,Bdescr(p)->gen_no); } } -- 1.7.10.4