#include "PosixSource.h"
#include "Rts.h"
+#include "GCThread.h"
#include "Storage.h"
#include "RtsUtils.h"
#include "BlockAlloc.h"
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);
if ( tso->why_blocked == BlockedOnMVar
|| tso->why_blocked == BlockedOnBlackHole
|| tso->why_blocked == BlockedOnMsgThrowTo
- || tso->why_blocked == BlockedOnMsgWakeup
) {
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);
}
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);
case CONSTR:
case PRIM:
case MUT_PRIM:
- case IND_PERM:
case MUT_VAR_CLEAN:
case MUT_VAR_DIRTY:
- case CAF_BLACKHOLE:
case BLACKHOLE:
+ case BLOCKING_QUEUE:
{
StgPtr end;
return p + sizeofW(StgMVar);
}
- case IND_OLDGEN:
- case IND_OLDGEN_PERM:
+ case IND:
+ case IND_PERM:
thread(&((StgInd *)p)->indirectee);
return p + sizeofW(StgInd);
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;
}
// relocate TSOs
- if (info->type == TSO) {
- move_TSO((StgTSO *)p, (StgTSO *)free);
+ if (info->type == STACK) {
+ move_STACK((StgStack *)p, (StgStack *)free);
}
free += size;
void
compact(StgClosure *static_objects)
{
- nat g, blocks;
+ nat n, g, blocks;
generation *gen;
// 1. thread the roots
markCapabilities((evac_fn)thread_root, NULL);
+ markScheduler((evac_fn)thread_root, NULL);
+
// the weak pointer lists...
if (weak_ptr_list != NULL) {
thread((void *)&weak_ptr_list);
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) {
// any threads resurrected during this GC
thread((void *)&resurrected_threads);
- // the blackhole queue
- thread((void *)&blackhole_queue);
-
// the task list
{
Task *task;
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);