Skip to content

Commit

Permalink
Ressurect usage of GC_generational_2_FLAG for bringing objects into same
Browse files Browse the repository at this point in the history
generation.

Main reason - we still have to process objects from current generation
because they can have fresh references to young objects.

git-svn-id: https://svn.parrot.org/parrot/branches/generational_gc@49650 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
bacek committed Oct 24, 2010
1 parent e7ece56 commit 48f13db
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/gc/gc_ms2.c
Expand Up @@ -911,10 +911,12 @@ gc_ms2_bring_them_together(PARROT_INTERP, ARGIN(List_Item_Header *old_object_tai
/* We are "marking" this generation */
self->current_generation = i;

/* mark can append more objects to this list */
while (tmp) {
PMC *pmc = LLH2Obj_typed(tmp, PMC);

/* mark can append more objects to this list */
pmc->flags |= PObj_GC_generation_2_FLAG;

if (PObj_custom_mark_TEST(pmc))
VTABLE_mark(interp, pmc);

Expand Down Expand Up @@ -993,7 +995,10 @@ gc_ms2_pmc_validate(PARROT_INTERP, ARGIN(PMC *pmc))
if (PObj_constant_TEST(pmc))
return;

PARROT_ASSERT(pobj2gen(pmc) == self->current_generation
if (pmc->flags & PObj_GC_generation_2_FLAG)
return;

PARROT_ASSERT(pobj2gen(pmc) >= self->current_generation
|| !"Got object from wrong generation");

pmc->flags |= PObj_GC_generation_2_FLAG;
Expand Down Expand Up @@ -1586,11 +1591,13 @@ gc_ms2_vtable_mark_propagate(PARROT_INTERP, ARGIN(PMC *pmc))
if (pmc->flags & PObj_constant_FLAG)
return;

if (gen != self->current_generation) {
LIST_REMOVE(self->objects[gen], item);
LIST_APPEND(self->objects[self->current_generation], item);
gc_ms2_set_gen_flags(interp, (PObj *)pmc, self->current_generation);
}
/* PMC was already processed */
if (pmc->flags & PObj_GC_generation_2_FLAG)
return;

LIST_REMOVE(self->objects[gen], item);
LIST_APPEND(self->objects[self->current_generation], item);
gc_ms2_set_gen_flags(interp, pmc, self->current_generation);

PObj_live_SET(pmc);
}
Expand Down Expand Up @@ -1652,7 +1659,7 @@ gc_ms2_sweep_pool(PARROT_INTERP,
if (PObj_live_TEST(obj)) {
/* Paint live objects white */
PObj_live_CLEAR(obj);
obj->flags &= ~PObj_GC_wb_triggered_FLAG;
obj->flags &= ~(PObj_GC_wb_triggered_FLAG | PObj_GC_generation_2_FLAG);
}
else if (!PObj_constant_TEST(obj)) {
callback(interp, obj);
Expand Down

0 comments on commit 48f13db

Please sign in to comment.