* evacuate to an older generation, adjust it here (see comment
* by evacuate()).
*/
- if (stp->gen_no < gct->evac_gen) {
+ if (stp < gct->evac_step) {
if (gct->eager_promotion) {
- stp = &generations[gct->evac_gen].steps[0];
+ stp = gct->evac_step;
} else {
gct->failed_to_evac = rtsTrue;
}
* evacuate to an older generation, adjust it here (see comment
* by evacuate()).
*/
- if (stp->gen_no < gct->evac_gen) {
+ if (stp < gct->evac_step) {
if (gct->eager_promotion) {
- stp = &generations[gct->evac_gen].steps[0];
+ stp = gct->evac_step;
} else {
gct->failed_to_evac = rtsTrue;
}
} while (info == (W_)&stg_WHITEHOLE_info);
if (info == (W_)&stg_EVACUATED_info) {
src->header.info = (const StgInfoTable *)info;
- return evacuate(src); // does the failed_to_evac stuff
+ return evacuate(p); // does the failed_to_evac stuff
}
#else
info = (W_)src->header.info;
} while (info == (W_)&stg_WHITEHOLE_info);
if (info == (W_)&stg_EVACUATED_info) {
src->header.info = (const StgInfoTable *)info;
- return evacuate(src); // does the failed_to_evac stuff
+ return evacuate(p); // does the failed_to_evac stuff
}
#else
info = (W_)src->header.info;
src->header.info = &stg_EVACUATED_info;
#endif
-
+
to = alloc_for_copy_noscav(size,stp);
tagged_to = (StgPtr)TAG_CLOSURE(tag,(StgClosure*)to);
*p = (StgClosure *)tagged_to;
} while (info == (W_)&stg_WHITEHOLE_info);
if (info == (W_)&stg_EVACUATED_info) {
src->header.info = (const StgInfoTable *)info;
- return evacuate(src); // does the failed_to_evac stuff
+ return evacuate(p); // does the failed_to_evac stuff
}
#else
info = (W_)src->header.info;
/* Don't forget to set the gct->failed_to_evac flag if we didn't get
* the desired destination (see comments in evacuate()).
*/
- if (bd->gen_no < gct->evac_gen) {
+ if (bd->step < gct->evac_step) {
gct->failed_to_evac = rtsTrue;
TICK_GC_FAILED_PROMOTION();
}
/* link it on to the evacuated large object list of the destination step
*/
stp = bd->step->to;
- if (stp->gen_no < gct->evac_gen) {
+ if (stp < gct->evac_step) {
if (gct->eager_promotion) {
- stp = &generations[gct->evac_gen].steps[0];
+ stp = gct->evac_step;
} else {
gct->failed_to_evac = rtsTrue;
}
This is called (eventually) for every live object in the system.
The caller to evacuate specifies a desired generation in the
- gct->evac_gen thread-lock variable. The following conditions apply to
+ gct->evac_step thread-local variable. The following conditions apply to
evacuating an object which resides in generation M when we're
collecting up to generation N
- if M >= gct->evac_gen
+ if M >= gct->evac_step
if M > N do nothing
else evac to step->to
- if M < gct->evac_gen evac to gct->evac_gen, step 0
+ if M < gct->evac_step evac to gct->evac_step, step 0
if the object is already evacuated, then we check which generation
it now resides in.
- if M >= gct->evac_gen do nothing
- if M < gct->evac_gen set gct->failed_to_evac flag to indicate that we
- didn't manage to evacuate this object into gct->evac_gen.
+ if M >= gct->evac_step do nothing
+ if M < gct->evac_step set gct->failed_to_evac flag to indicate that we
+ didn't manage to evacuate this object into gct->evac_step.
OPTIMISATION NOTES:
if (bd->gen_no > N) {
/* Can't evacuate this object, because it's in a generation
* older than the ones we're collecting. Let's hope that it's
- * in gct->evac_gen or older, or we will have to arrange to track
+ * in gct->evac_step or older, or we will have to arrange to track
* this pointer using the mutable list.
*/
- if (bd->gen_no < gct->evac_gen) {
+ if (bd->step < gct->evac_step) {
// nope
gct->failed_to_evac = rtsTrue;
TICK_GC_FAILED_PROMOTION();
* object twice, for example).
*/
if (bd->flags & BF_EVACUATED) {
- if (bd->gen_no < gct->evac_gen) {
+ if (bd->step < gct->evac_step) {
gct->failed_to_evac = rtsTrue;
TICK_GC_FAILED_PROMOTION();
}
case EVACUATED:
/* Already evacuated, just return the forwarding address.
- * HOWEVER: if the requested destination generation (gct->evac_gen) is
+ * HOWEVER: if the requested destination generation (gct->evac_step) is
* older than the actual generation (because the object was
* already evacuated to a younger generation) then we have to
* set the gct->failed_to_evac flag to indicate that we couldn't
{
StgClosure *e = ((StgEvacuated*)q)->evacuee;
*p = e;
- if (gct->evac_gen > 0 && stp->gen_no < gct->evac_gen) { // optimisation
- if (HEAP_ALLOCED(e) && Bdescr((P_)e)->gen_no < gct->evac_gen) {
+ if (stp < gct->evac_step) { // optimisation
+ if (HEAP_ALLOCED(e) && Bdescr((P_)e)->step < gct->evac_step) {
gct->failed_to_evac = rtsTrue;
TICK_GC_FAILED_PROMOTION();
}