#define INLINE inline
#endif
+#include "PosixSource.h"
#include "Rts.h"
+
#include "RtsUtils.h"
#include "RetainerProfile.h"
#include "RetainerSet.h"
#include "Schedule.h"
#include "Printer.h"
-#include "RtsFlags.h"
#include "Weak.h"
-#include "Sanity.h"
+#include "sm/Sanity.h"
#include "Profiling.h"
#include "Stats.h"
#include "ProfHeap.h"
#include "Apply.h"
+#include "sm/Storage.h" // for END_OF_STATIC_LIST
/*
Note: what to change in order to plug-in a new retainer profiling scheme?
case CONSTR_0_2:
case CAF_BLACKHOLE:
case BLACKHOLE:
- case SE_BLACKHOLE:
- case SE_CAF_BLACKHOLE:
case ARR_WORDS:
*first_child = NULL;
return;
// layout.payload.ptrs, no SRT
case CONSTR:
- case STABLE_NAME:
+ case PRIM:
+ case MUT_PRIM:
case BCO:
case CONSTR_STATIC:
init_ptrs(&se.info, get_itbl(c)->layout.payload.ptrs,
return; // no child
break;
- case TVAR_WATCH_QUEUE:
- *first_child = (StgClosure *)((StgTVarWatchQueue *)c)->closure;
- se.info.next.step = 2; // 2 = second
- break;
- case TVAR:
- *first_child = (StgClosure *)((StgTVar *)c)->current_value;
- break;
- case TREC_HEADER:
- *first_child = (StgClosure *)((StgTRecHeader *)c)->enclosing_trec;
- break;
case TREC_CHUNK:
*first_child = (StgClosure *)((StgTRecChunk *)c)->prev_chunk;
se.info.next.step = 0; // entry no.
case RET_BIG:
// invalid objects
case IND:
- case BLOCKED_FETCH:
- case FETCH_ME:
- case FETCH_ME_BQ:
- case RBH:
- case REMOTE_REF:
- case EVACUATED:
case INVALID_OBJECT:
default:
barf("Invalid object *c in push()");
*r = se->c_child_r;
return;
- case TVAR_WATCH_QUEUE:
- if (se->info.next.step == 2) {
- *c = (StgClosure *)((StgTVarWatchQueue *)se->c)->next_queue_entry;
- se->info.next.step++; // move to the next step
- // no popOff
- } else {
- *c = (StgClosure *)((StgTVarWatchQueue *)se->c)->prev_queue_entry;
- popOff();
- }
- *cp = se->c;
- *r = se->c_child_r;
- return;
-
- case TVAR:
- *c = (StgClosure *)((StgTVar *)se->c)->first_watch_queue_entry;
- *cp = se->c;
- *r = se->c_child_r;
- popOff();
- return;
-
- case TREC_HEADER:
- *c = (StgClosure *)((StgTRecHeader *)se->c)->current_chunk;
- *cp = se->c;
- *r = se->c_child_r;
- popOff();
- return;
-
case TREC_CHUNK: {
// These are pretty complicated: we have N entries, each
// of which contains 3 fields that we want to follow. So
}
case CONSTR:
- case STABLE_NAME:
+ case PRIM:
+ case MUT_PRIM:
case BCO:
case CONSTR_STATIC:
// StgMutArrPtr.ptrs, no SRT
case CONSTR_0_2:
case CAF_BLACKHOLE:
case BLACKHOLE:
- case SE_BLACKHOLE:
- case SE_CAF_BLACKHOLE:
case ARR_WORDS:
// one child (fixed), no SRT
case MUT_VAR_CLEAN:
case RET_BIG:
// invalid objects
case IND:
- case BLOCKED_FETCH:
- case FETCH_ME:
- case FETCH_ME_BQ:
- case RBH:
- case REMOTE_REF:
- case EVACUATED:
case INVALID_OBJECT:
default:
barf("Invalid object *c in pop()");
case TSO:
// mutable objects
+ case MUT_PRIM:
case MVAR_CLEAN:
case MVAR_DIRTY:
case MUT_VAR_CLEAN:
// WEAK objects are roots; there is separate code in which traversing
// begins from WEAK objects.
case WEAK:
-
- // Since the other mutvar-type things are retainers, seems
- // like the right thing to do:
- case TVAR:
return rtsTrue;
//
// blackholes
case CAF_BLACKHOLE:
case BLACKHOLE:
- case SE_BLACKHOLE:
- case SE_CAF_BLACKHOLE:
// indirection
case IND_PERM:
case IND_OLDGEN_PERM:
case CONSTR_STATIC:
case FUN_STATIC:
// misc
- case STABLE_NAME:
+ case PRIM:
case BCO:
case ARR_WORDS:
// STM
- case TVAR_WATCH_QUEUE:
- case TREC_HEADER:
case TREC_CHUNK:
return rtsFalse;
case RET_BIG:
// other cases
case IND:
- case BLOCKED_FETCH:
- case FETCH_ME:
- case FETCH_ME_BQ:
- case RBH:
- case REMOTE_REF:
- case EVACUATED:
case INVALID_OBJECT:
default:
barf("Invalid object in isRetainer(): %d", get_itbl(c)->type);
while (bitmap != 0) {
if ((bitmap & 1) != 0) {
-#ifdef ENABLE_WIN32_DLL_SUPPORT
+#if defined(__PIC__) && defined(mingw32_TARGET_OS)
if ( (unsigned long)(*srt) & 0x1 ) {
- retainClosure(*stgCast(StgClosure**,(stgCast(unsigned long, *srt) & ~0x1)),
+ retainClosure(* (StgClosure**) ((unsigned long) (*srt) & ~0x1),
c, c_child_r);
} else {
retainClosure(*srt,c,c_child_r);
// for retainer profilng.
for (weak = weak_ptr_list; weak != NULL; weak = weak->link)
// retainRoot((StgClosure *)weak);
- retainRoot((StgClosure **)&weak, NULL);
+ retainRoot(NULL, (StgClosure **)&weak);
// Consider roots from the stable ptr table.
markStablePtrTable(retainRoot, NULL);