X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FEvac.c;h=9836e51376934723924f69a694650e2b022edc6e;hb=f9d15f9fccae4706fbdf8ee4ecaef7da9953cb74;hp=6fcafc4c7dce295917b9fd8a82df4502ce066ec7;hpb=c572f87a790dc313ffae3266dba05844c0fdb4ca;p=ghc-hetmet.git diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 6fcafc4..9836e51 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -20,6 +20,7 @@ #include "GCThread.h" #include "GCUtils.h" #include "Compact.h" +#include "MarkStack.h" #include "Prelude.h" #include "Trace.h" #include "LdvProfile.h" @@ -97,8 +98,6 @@ copy_tag(StgClosure **p, const StgInfoTable *info, to = alloc_for_copy(size,stp); - TICK_GC_WORDS_COPIED(size); - from = (StgPtr)src; to[0] = (W_)info; for (i = 1; i < size; i++) { // unroll for small i @@ -143,8 +142,6 @@ copy_tag_nolock(StgClosure **p, const StgInfoTable *info, *p = TAG_CLOSURE(tag,(StgClosure*)to); src->header.info = (const StgInfoTable *)MK_FORWARDING_PTR(to); - TICK_GC_WORDS_COPIED(size); - from = (StgPtr)src; to[0] = (W_)info; for (i = 1; i < size; i++) { // unroll for small i @@ -195,8 +192,6 @@ spin: to = alloc_for_copy(size_to_reserve, stp); *p = (StgClosure *)to; - TICK_GC_WORDS_COPIED(size_to_copy); - from = (StgPtr)src; to[0] = info; for (i = 1; i < size_to_copy; i++) { // unroll for small i @@ -287,8 +282,7 @@ evacuate_large(StgPtr p) ws = &gct->steps[new_stp->abs_no]; bd->flags |= BF_EVACUATED; - bd->step = new_stp; - bd->gen_no = new_stp->gen_no; + initBdescr(bd, new_stp); // If this is a block of pinned objects, we don't have to scan // these objects, because they aren't allowed to contain any @@ -505,17 +499,12 @@ loop: */ if (!is_marked((P_)q,bd)) { mark((P_)q,bd); - if (mark_stack_full()) { - debugTrace(DEBUG_gc,"mark stack overflowed"); - mark_stack_overflowed = rtsTrue; - reset_mark_stack(); - } push_mark_stack((P_)q); } return; } - stp = bd->step->to; + stp = bd->dest; info = q->header.info; if (IS_FORWARDING_PTR(info)) @@ -559,8 +548,17 @@ loop: copy(p,info,q,sizeW_fromITBL(INFO_PTR_TO_STRUCT(info)),stp); return; + // For ints and chars of low value, save space by replacing references to + // these with closures with references to common, shared ones in the RTS. + // + // * Except when compiling into Windows DLLs which don't support cross-package + // data references very well. + // case CONSTR_0_1: - { + { +#if defined(__PIC__) && defined(mingw32_HOST_OS) + copy_tag_nolock(p,info,q,sizeofW(StgHeader)+1,stp,tag); +#else StgWord w = (StgWord)q->payload[0]; if (info == Czh_con_info && // unsigned, so always true: (StgChar)w >= MIN_CHARLIKE && @@ -578,6 +576,7 @@ loop: else { copy_tag_nolock(p,info,q,sizeofW(StgHeader)+1,stp,tag); } +#endif return; } @@ -1069,7 +1068,7 @@ bale_out: // check whether it was updated in the meantime. *q = (StgClosure *)p; if (evac) { - copy(q,(const StgInfoTable *)info_ptr,(StgClosure *)p,THUNK_SELECTOR_sizeW(),bd->step->to); + copy(q,(const StgInfoTable *)info_ptr,(StgClosure *)p,THUNK_SELECTOR_sizeW(),bd->dest); } unchain_thunk_selectors(prev_thunk_selector, *q); return;