X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2Fsm%2FCompact.c;h=ff7480cd57e0aa30a8d77abcfa36ff9c54414b6f;hp=fd6c92fdd16ca6af8506723bca455e5a631b3177;hb=367d9a0f37b3be938d14c650434beee3c79814fe;hpb=70a2431f90fa932733ce015714ef7848640ed48f diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c index fd6c92f..ff7480c 100644 --- a/rts/sm/Compact.c +++ b/rts/sm/Compact.c @@ -14,6 +14,7 @@ #include "PosixSource.h" #include "Rts.h" +#include "GCThread.h" #include "Storage.h" #include "RtsUtils.h" #include "BlockAlloc.h" @@ -335,8 +336,9 @@ thread_stack(StgPtr p, StgPtr stack_end) case CATCH_STM_FRAME: case ATOMICALLY_FRAME: case UPDATE_FRAME: - case STOP_FRAME: - case CATCH_FRAME: + case UNDERFLOW_FRAME: + case STOP_FRAME: + case CATCH_FRAME: case RET_SMALL: bitmap = BITMAP_BITS(info->i.layout.bitmap); size = BITMAP_SIZE(info->i.layout.bitmap); @@ -476,11 +478,12 @@ thread_TSO (StgTSO *tso) thread_(&tso->block_info.closure); } thread_(&tso->blocked_exceptions); + thread_(&tso->bq); thread_(&tso->trec); - thread_stack(tso->sp, &(tso->stack[tso->stack_size])); - return (StgPtr)tso + tso_sizeW(tso); + thread_(&tso->stackobj); + return (StgPtr)tso + sizeofW(StgTSO); } @@ -520,9 +523,12 @@ update_fwd_large( bdescr *bd ) continue; } - case TSO: - thread_TSO((StgTSO *)p); - continue; + case STACK: + { + StgStack *stack = (StgStack*)p; + thread_stack(stack->sp, stack->stack + stack->stack_size); + continue; + } case AP_STACK: thread_AP_STACK((StgAP_STACK *)p); @@ -705,6 +711,13 @@ thread_obj (StgInfoTable *info, StgPtr p) case TSO: return thread_TSO((StgTSO *)p); + case STACK: + { + StgStack *stack = (StgStack*)p; + thread_stack(stack->sp, stack->stack + stack->stack_size); + return p + stack_sizeW(stack); + } + case TREC_CHUNK: { StgWord i; @@ -898,8 +911,8 @@ update_bkwd_compact( generation *gen ) } // relocate TSOs - if (info->type == TSO) { - move_TSO((StgTSO *)p, (StgTSO *)free); + if (info->type == STACK) { + move_STACK((StgStack *)p, (StgStack *)free); } free += size; @@ -923,7 +936,7 @@ update_bkwd_compact( generation *gen ) void compact(StgClosure *static_objects) { - nat g, blocks; + nat n, g, blocks; generation *gen; // 1. thread the roots @@ -941,12 +954,6 @@ compact(StgClosure *static_objects) for (g = 1; g < RtsFlags.GcFlags.generations; g++) { bdescr *bd; StgPtr p; - nat n; - for (bd = generations[g].mut_list; bd != NULL; bd = bd->link) { - for (p = bd->start; p < bd->free; p++) { - thread((StgClosure **)p); - } - } for (n = 0; n < n_capabilities; n++) { for (bd = capabilities[n].mut_lists[g]; bd != NULL; bd = bd->link) { @@ -994,6 +1001,10 @@ compact(StgClosure *static_objects) debugTrace(DEBUG_gc, "update_fwd: %d", g); update_fwd(gen->blocks); + for (n = 0; n < n_capabilities; n++) { + update_fwd(gc_threads[n]->gens[g].todo_bd); + update_fwd(gc_threads[n]->gens[g].part_list); + } update_fwd_large(gen->scavenged_large_objects); if (g == RtsFlags.GcFlags.generations-1 && gen->old_blocks != NULL) { debugTrace(DEBUG_gc, "update_fwd: %d (compact)", g);