X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fsm%2FEvac.c-inc;h=0f2cc6d556dbb41a43a9e819888bac684ff9d960;hb=29d9667f3bed7bdfc1839411cd40aef09d4b0fc1;hp=6fa93d15a4cbbcbd0354be35e4b8a25c01373529;hpb=d13df738cbbe8017ae19ae2702f4e10805ee521b;p=ghc-hetmet.git diff --git a/rts/sm/Evac.c-inc b/rts/sm/Evac.c-inc index 6fa93d1..0f2cc6d 100644 --- a/rts/sm/Evac.c-inc +++ b/rts/sm/Evac.c-inc @@ -1,4 +1,4 @@ -/* ----------------------------------------------------------------------------- +/* -----------------------------------------------------------------------*-c-*- * * (c) The GHC Team 1998-2006 * @@ -23,7 +23,7 @@ #endif STATIC_INLINE void -copy_tag(StgClosure **p, StgClosure *src, nat size, step *stp) +copy_tag(StgClosure **p, StgClosure *src, nat size, step *stp, StgWord tag) { StgPtr to, tagged_to, from; nat i; @@ -34,11 +34,14 @@ copy_tag(StgClosure **p, StgClosure *src, nat size, step *stp) info = xchg((StgPtr)&src->header.info, (W_)&stg_WHITEHOLE_info); // so.. what is it? } while (info == (W_)&stg_WHITEHOLE_info); - if (info == (W_)&stg_EVACUATED_info) { + if (info == (W_)&stg_EVACUATED_info || info == (W_)&stg_IND_info) { + // NB. a closure might be updated with an IND by + // unchain_selector_thunks(), hence the test above. src->header.info = (const StgInfoTable *)info; return evacuate(p); // does the failed_to_evac stuff } #else + ASSERT(n_gc_threads == 1); info = (W_)src->header.info; src->header.info = &stg_EVACUATED_info; #endif @@ -353,7 +356,7 @@ loop: (StgClosure *)CHARLIKE_CLOSURE((StgChar)w) ); } - if (q->header.info == Izh_con_info && + else if (q->header.info == Izh_con_info && (StgInt)w >= MIN_INTLIKE && (StgInt)w <= MAX_INTLIKE) { *p = TAG_CLOSURE(tag, (StgClosure *)INTLIKE_CLOSURE((StgInt)w) @@ -482,7 +485,7 @@ loop: StgClosure *e = ((StgEvacuated*)q)->evacuee; *p = e; if (stp < gct->evac_step) { // optimisation - if (HEAP_ALLOCED(e) && Bdescr((P_)e)->step < gct->evac_step) { + if (Bdescr((P_)e)->step < gct->evac_step) { gct->failed_to_evac = rtsTrue; TICK_GC_FAILED_PROMOTION(); } @@ -563,3 +566,8 @@ loop: barf("evacuate"); } + +#undef copy +#undef copy_tag +#undef copyPart +#undef evacuate