Changes between Initial Version and Version 1 of GenerationalMarkSweep

Show
Ignore:
Timestamp:
05/02/10 00:31:36 (10 years ago)
Author:
bacek
Comment:

Initial cut of GMS.

Legend:

Unmodified
Added
Removed
Modified
  • GenerationalMarkSweep

    v1 v1  
     1How to implement GMS in Parrot. 
     2 
     3There is 2 complex things in implementing Generational GC: 
     4  * Skip older generations during marking younger. 
     5  * Properly handle old-to-young pointers. 
     6 
     7Usually first part implemented with help of Compacting GC when survived {{{young}}} objects 
     8moved into {{{old}}} generation physically. It will require some substantial changes in Parrot's 
     9GC. Instead I'm going to add integer {{{generation}}} field into {{{PObj}}} and skip older objects 
     10during marking young ones. 
     11 
     12Second part can be implemented in various ways - {{{mprotect}}} on old objects, {{{mprotect}}} of whole generations, 
     13manually inserting WriteBarriers, etc. But because we have VTABLEs API and most of access to PMCs go through it we can 
     14use idea from http://research.microsoft.com/en-us/um/people/simonpj/papers/non-stop/index.htm to insert write barriers 
     15automatically. 
     16 
     17  * Add {{{VTABLE *write_barrier_variant}}} into {{{VTABLE}}} 
     18  * Patch Pmc2c to create new "write barrier" VTABLE. 
     19  * Every method marked with :write will have body like this 
     20{{{ 
     21   VTABLE_foo() { 
     22       Parrot_gc_write_barrier(INTERP, SELF); 
     23       SELF->vtable = SELF->vtable->write_barrier_variant; 
     24       SELF.foo(); 
     25   } 
     26}}} 
     27  * {{{Parrot_gc_write_barrier}}} will add PMC into {{{root set}}} 
     28  * GMS will have {{{current_generation}}} property during mark. 
     29  * {{{Parrot_gc_mark_PMC_alive}}} will skip older objects during marking.