diff options
Diffstat (limited to 'rts/sm')
-rw-r--r-- | rts/sm/NonMovingMark.c | 32 | ||||
-rw-r--r-- | rts/sm/NonMovingMark.h | 1 | ||||
-rw-r--r-- | rts/sm/Storage.c | 3 |
3 files changed, 25 insertions, 11 deletions
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c index 87b8f774bd..3b227bb805 100644 --- a/rts/sm/NonMovingMark.c +++ b/rts/sm/NonMovingMark.c @@ -687,21 +687,26 @@ STATIC_INLINE bool needs_upd_rem_set_mark(StgClosure *p) } } +static void finish_upd_rem_set_mark_large(bdescr* bd) { + // Someone else may have already marked it. + ACQUIRE_LOCK(&nonmoving_large_objects_mutex); + if (! (bd->flags & BF_MARKED)) { + bd->flags |= BF_MARKED; + dbl_link_remove(bd, &nonmoving_large_objects); + dbl_link_onto(bd, &nonmoving_marked_large_objects); + n_nonmoving_large_blocks -= bd->blocks; + n_nonmoving_marked_large_blocks += bd->blocks; + } + RELEASE_LOCK(&nonmoving_large_objects_mutex); +} + /* Set the mark bit; only to be called *after* we have fully marked the closure */ STATIC_INLINE void finish_upd_rem_set_mark(StgClosure *p) { bdescr *bd = Bdescr((StgPtr) p); if (bd->flags & BF_LARGE) { - // Someone else may have already marked it. - ACQUIRE_LOCK(&nonmoving_large_objects_mutex); - if (! (bd->flags & BF_MARKED)) { - bd->flags |= BF_MARKED; - dbl_link_remove(bd, &nonmoving_large_objects); - dbl_link_onto(bd, &nonmoving_marked_large_objects); - n_nonmoving_large_blocks -= bd->blocks; - n_nonmoving_marked_large_blocks += bd->blocks; - } - RELEASE_LOCK(&nonmoving_large_objects_mutex); + // This function is extracted so that this function can be inline + finish_upd_rem_set_mark_large(bd); } else { struct NonmovingSegment *seg = nonmovingGetSegment((StgPtr) p); nonmoving_block_idx block_idx = nonmovingGetBlockIdx((StgPtr) p); @@ -746,6 +751,13 @@ void updateRemembSetPushStack(Capability *cap, StgStack *stack) } } +void updateRemembSetPushMessageThrowTo(Capability *cap, MessageThrowTo *m) { + updateRemembSetPushClosure(cap, (StgClosure *) m->link); + updateRemembSetPushClosure(cap, (StgClosure *) m->source); + updateRemembSetPushClosure(cap, (StgClosure *) m->target); + updateRemembSetPushClosure(cap, (StgClosure *) m->exception); +} + /********************************************************* * Pushing to the mark queue *********************************************************/ diff --git a/rts/sm/NonMovingMark.h b/rts/sm/NonMovingMark.h index 0938e2775a..1cfcc860bf 100644 --- a/rts/sm/NonMovingMark.h +++ b/rts/sm/NonMovingMark.h @@ -143,6 +143,7 @@ void updateRemembSetPushClosure(Capability *cap, StgClosure *p); void updateRemembSetPushThunk(Capability *cap, StgThunk *p); void updateRemembSetPushTSO(Capability *cap, StgTSO *tso); void updateRemembSetPushStack(Capability *cap, StgStack *stack); +void updateRemembSetPushMessageThrowTo(Capability *cap, MessageThrowTo *m); #if defined(THREADED_RTS) void nonmovingFlushCapUpdRemSetBlocks(Capability *cap); diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index c592595737..1e801b8dfc 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -109,6 +109,7 @@ Mutex sm_mutex; static void allocNurseries (uint32_t from, uint32_t to); static void assignNurseriesToCapabilities (uint32_t from, uint32_t to); +static StgInd * lockCAF (StgRegTable *reg, StgIndStatic *caf); void initGeneration (generation *gen, int g) @@ -510,7 +511,7 @@ void listAllBlocks (ListBlocksCb cb, void *user) -------------------------------------------------------------------------- */ -STATIC_INLINE StgInd * +static StgInd * lockCAF (StgRegTable *reg, StgIndStatic *caf) { const StgInfoTable *orig_info; |