summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-02-09 15:04:20 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-02-09 15:04:20 +0000
commit608bc3f3ad6fca14a23529f314dbd9d3342a9507 (patch)
tree2337aeb2cb7cfef1e3913ac4cb6897e0c05965c9
parent7b2ff4cc95ce49081d84c25184aec796377fbc35 (diff)
downloadhaskell-608bc3f3ad6fca14a23529f314dbd9d3342a9507.tar.gz
change dirty_MUT_VAR() to use recordMutableCap()
rather than recordMutableGen(), the former works better in SMP
-rw-r--r--ghc/compiler/codeGen/CgPrimOp.hs3
-rw-r--r--ghc/includes/RtsExternal.h2
-rw-r--r--ghc/includes/Storage.h2
-rw-r--r--ghc/rts/PrimOps.cmm2
-rw-r--r--ghc/rts/Storage.c5
5 files changed, 8 insertions, 6 deletions
diff --git a/ghc/compiler/codeGen/CgPrimOp.hs b/ghc/compiler/codeGen/CgPrimOp.hs
index 7de4516af7..c1264be62f 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 c5f5043e5c..61a920b0ab 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 c339c4e012..8709f1824b 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 58948da25a..049e4e25f5 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 28ccf79f50..58687302ef 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);
}
}