[svn:parrot] r36628 - trunk/src/gc

cotto at svn.parrot.org cotto at svn.parrot.org
Thu Feb 12 11:49:32 UTC 2009


Author: cotto
Date: Thu Feb 12 11:49:30 2009
New Revision: 36628
URL: https://trac.parrot.org/parrot/changeset/36628

Log:
[gc] remove most references to DOD in the GC code (comment-only changes)

Modified:
   trunk/src/gc/api.c
   trunk/src/gc/generational_ms.c
   trunk/src/gc/incremental_ms.c
   trunk/src/gc/mark_sweep.c
   trunk/src/gc/res_lea.c
   trunk/src/gc/resources.c

Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c	Thu Feb 12 11:39:41 2009	(r36627)
+++ trunk/src/gc/api.c	Thu Feb 12 11:49:30 2009	(r36628)
@@ -425,7 +425,7 @@
 
 =item C<void Parrot_gc_profile_start>
 
-Records the start time of a DOD run when profiling is enabled.
+Records the start time of a GC mark run when profiling is enabled.
 
 =cut
 
@@ -443,7 +443,7 @@
 
 =item C<void Parrot_gc_profile_end>
 
-Records the end time of the DOD part C<what> run when profiling is
+Records the end time of the GC mark run part C<what> run when profiling is
 enabled. Also record start time of next part.
 
 =cut
@@ -462,7 +462,7 @@
         profile->data[what].time += now - profile->gc_time;
 
         /*
-         * we've recorded the time of a DOD/GC piece from
+         * we've recorded the time of a GC piece from
          * gc_time until now, so add this to the start of the
          * currently executing opcode, which hasn't run this
          * interval.
@@ -478,7 +478,7 @@
 
 =item C<void Parrot_gc_ms_run_init>
 
-Prepares the collector for a mark & sweep DOD run. This is the
+Prepares the collector for a mark & sweep GC run. This is the
 initializer function for the MS garbage collector.
 
 =cut

Modified: trunk/src/gc/generational_ms.c
==============================================================================
--- trunk/src/gc/generational_ms.c	Thu Feb 12 11:39:41 2009	(r36627)
+++ trunk/src/gc/generational_ms.c	Thu Feb 12 11:49:30 2009	(r36628)
@@ -1240,7 +1240,7 @@
      * 2) Merge the blacks to the existing older generation
      *    The plan to use depends on the interpreter, specifically, if
      *    we are doing a lazy run, entering a new scope, or what not.
-     * 3) If we are leaving a scope (denoted by a lazy DOD run
+     * 3) If we are leaving a scope (denoted by a lazy GC run
      *    and we had created one or more generations in this scope
      *    go back by resetting the generation number to the outer
      *    scope's generation

Modified: trunk/src/gc/incremental_ms.c
==============================================================================
--- trunk/src/gc/incremental_ms.c	Thu Feb 12 11:39:41 2009	(r36627)
+++ trunk/src/gc/incremental_ms.c	Thu Feb 12 11:49:30 2009	(r36628)
@@ -52,21 +52,16 @@
 
 All objects have one of three colors: white, grey, or black.
 
-At the beginning of a DOD run all objects are white (not yet visited).
+At the beginning of a GC mark run all objects are white (not yet visited).
 During marking objects are greyed (visited - found alive), but their
 contents isn't yet scanned. A fully scanned grey object gets finally
-colored black. It will not again be rescanned in this DOD run.
+colored black. It will not again be rescanned in this run.
 
 Only aggregates can be grey, non-containers are blackened immediately.
 
 Objects on the free-list are sometimes denoted having the color off-white
 or ecru.
 
-=item DOD
-
-Dead object detection. Please note that in Parrot src and docs this
-stands for the stop-the-world garbage collector that recycles objects.
-
 =item GC
 
 In Parrot tree the copying garbage collector that recycles string and
@@ -75,7 +70,7 @@
 
 =item collector
 
-The DOD and reclamation system.
+The reclamation system.
 
 =item mutator
 
@@ -106,7 +101,7 @@
 white object, so that it's reachable.
 
 The strong invariant is the basic idea of mark and sweep too. But as the
-mutator isn't running during DOD the invariant is never violated.
+mutator isn't running during mark phase, the invariant is never violated.
 
 Due to this invariant, after the root set has been marked and when all
 greyed objects are marked (blackened), the white objects have to be
@@ -179,9 +174,9 @@
    free-list-ptr     to-space          scan-pointer      from-space
 
 Objects get "moved" during collection by rearranging the doubly-linked
-object pointers. At the end of a DOD run (when the last grey object is
+object pointers. At the end of a mark run (when the last grey object is
 blackened), the from-space and the free-list are merged serving
-as the new free-list of the next DOD cycle. This operation is just a few
+as the new free-list of the next GC cycle. This operation is just a few
 pointer manipulations that replaces the sweep phase of a mark and sweep
 collector.
 
@@ -191,7 +186,7 @@
 
 =item a) initialization
 
-After interpreter creation the DOD system is initialized by marking
+After interpreter creation the GC system is initialized by marking
 parts of the root set (globals, internal structures).
 
 =item b) program operation
@@ -203,14 +198,14 @@
 
 To keep the memory usage limited k > 1 must hold.
 
-=item c) near the end of a DOD cycle
+=item c) near the end of a mark phase
 
 The rest of the root set is scanned, i.e. the registers. By deferring
 scanning of registers all temporaries that might have exist somewhen
-just stay unscanned - they will be collected in this DOD cycle, if
-we allocate new objects white or in the next DOD cycle.
+just stay unscanned - they will be collected in this mark phase, if
+we allocate new objects white or in the next mark phase.
 
-=item d) finishing a DOD cycle
+=item d) finishing a mark phase
 
 The current sweep of the whole arena is done, or with implicit reclamation:
 
@@ -222,7 +217,7 @@
 Now he meaning of the black bit is reversed effectively setting the new
 from-space to white.
 
-The next DOD cycle is initialized in one step a) and the new cycle starts.
+The next mark phase is initialized in one step a) and the new cycle starts.
 
 Alternatively the mutator could run and allocate objects for some time,
 without starting the collector again, if there are plenty of free objects on
@@ -247,7 +242,7 @@
                        MS                 IMS               IMIR
   ------------------------------------------------------------------------
   operation            stop-the-world     incremental       incremental
-  time per DOD cycle   unbounded          bounded           bounded
+  time per mark phase  unbounded          bounded           bounded
   size overhead        1 word             1 word            2 words
   time overhead        O(2*live + dead)   O(2*live + dead)  O(live)   2)
 
@@ -279,7 +274,7 @@
 =item big aggregates
 
 Greying has to be done in increments. Big aggregates can't have a mark
-vtable that could run arbitrarily long. This means that the DOD system
+vtable that could run arbitrarily long. This means that the GC system
 must know the layout of arrays, hashes, and objects. This is currently
 true for arrays and objects but not for hashes. But the latter need some
 refactoring of internals anyway.
@@ -297,11 +292,11 @@
 timely destruction. When during scope exit an high priority sweep is
 triggered, we have basically two cases:
 
-1) all of these objects were already seen by this DOD run - the scope
+1) all of these objects were already seen in this mark phase - the scope
 exit can continue.
 
 2) Not all objects were seen - they might be alive or not. This means
-that the DOD cycle must run to the end to decide, if these objects are
+that the mark phase must run to the end to decide, if these objects are
 alive (or again until all are found alive).
 
 To increase performance its likely that we need some additional
@@ -469,7 +464,7 @@
  * that this amount of the total size could be freed
  *
  * This factor also depends on the allocation color of buffer headers,
- * which is set to black now. So we are always one DOD cycle behind
+ * which is set to black now. So we are always one mark phase behind
  * and the statistics are rather wrong.
  */
 #define MEM_POOL_RECLAIM      0.2
@@ -482,7 +477,7 @@
 
 typedef enum {          /* these states have to be in execution order */
     GC_IMS_INITIAL,     /* memory subsystem setup */
-    GC_IMS_STARTING,    /* wait for DOD_block to clear */
+    GC_IMS_STARTING,    /* wait for gc_block_level to clear */
     GC_IMS_RE_INIT,     /* start of normal operation - mark root */
     GC_IMS_MARKING,     /* mark children */
     GC_IMS_START_SWEEP, /* mark finished, start sweep buffers */
@@ -569,7 +564,7 @@
     /*
      * buffers are born black, PMCs not yet?
      * XXX this does not solve the problem of storing keys in hashes
-     *     in the next DOD cycle (if the key isn't marked elsewhere ?)
+     *     in the next mark phase (if the key isn't marked elsewhere ?)
      */
     PObj_flags_SETTO(ptr, pool == arena_base->pmc_pool ? 0 : PObj_live_FLAG);
     --pool->num_free_objects;
@@ -1076,7 +1071,7 @@
         return;
     }
 
-    /* lazy DOD handling */
+    /* lazy GC handling */
     IMS_DEBUG((stderr, "\nLAZY state = %d\n", g_ims->state));
     g_ims->lazy = lazy;
 

Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c	Thu Feb 12 11:39:41 2009	(r36627)
+++ trunk/src/gc/mark_sweep.c	Thu Feb 12 11:49:30 2009	(r36628)
@@ -162,7 +162,7 @@
 
     if (interp->pdb && interp->pdb->debugger) {
         /*
-         * if the other interpreter did a DOD run, it can set
+         * if the other interpreter did a GC mark run, it can set
          * live bits of shared objects, but these aren't reset, because
          * they are in a different arena. When now such a PMC points to
          * other non-shared object, these wouldn't be marked and hence
@@ -197,7 +197,7 @@
     ++arena_base->gc_mark_block_level;
     arena_base->lazy_gc = flags & GC_lazy_FLAG;
 
-    /* tell the threading system that we're doing DOD mark */
+    /* tell the threading system that we're doing GC mark */
     pt_gc_start_mark(interp);
     Parrot_gc_ms_run_init(interp);
 
@@ -247,7 +247,7 @@
 
 =item C<int Parrot_gc_trace_root>
 
-Traces the root set. Returns 0 if it's a lazy DOD run and all objects
+Traces the root set. Returns 0 if it's a lazy GC run and all objects
 that need timely destruction were found.
 
 C<trace_stack> can have these values:
@@ -280,7 +280,7 @@
     Parrot_Context   *ctx;
     PObj             *obj;
 
-    /* note: adding locals here did cause increased DOD runs */
+    /* note: adding locals here did cause increased GC runs */
     mark_context_start();
 
     if (trace == GC_TRACE_SYSTEM_ONLY) {
@@ -319,7 +319,7 @@
      * XXX these PMCs are constant and shouldn't get collected
      * but t/library/dumper* fails w/o this marking.
      *
-     * It seems that the Class PMC gets DODed - these should
+     * It seems that the Class PMC gets GCed - these should
      * get created as constant PMCs.
      */
     mark_vtables(interp);
@@ -607,7 +607,7 @@
      * pointers of the originating interpreter.
      *
      * We are possibly changing another interpreter's data here, so
-     * the mark phase of DOD must run only on one interpreter of a pool
+     * the mark phase of GC must run only on one interpreter of a pool
      * at a time. However, freeing unused objects can occur in parallel.
      * And: to be sure that a shared object is dead, we have to finish
      * the mark phase of all interpreters in a pool that might reference
@@ -681,7 +681,7 @@
 
 =item C<static void more_traceable_objects>
 
-We're out of traceable objects. First we try a DOD run to free some up. If
+We're out of traceable objects. First we try a GC run to free some up. If
 that doesn't work, allocate a new arena.
 
 =cut
@@ -764,7 +764,7 @@
 
 Free object allocator for the MS garbage collector system. If there are no
 free objects, call C<gc_ms_add_free_object> to either free them up with a
-DOD run, or allocate new objects. If there are objects available on the
+GC run, or allocate new objects. If there are objects available on the
 free list, pop it off and return it.
 
 =cut

Modified: trunk/src/gc/res_lea.c
==============================================================================
--- trunk/src/gc/res_lea.c	Thu Feb 12 11:39:41 2009	(r36627)
+++ trunk/src/gc/res_lea.c	Thu Feb 12 11:49:30 2009	(r36628)
@@ -120,7 +120,7 @@
 =item C<void Parrot_reallocate(PARROT_INTERP, Buffer *buffer, size_t newsize)>
 
 COWable objects (strings or Buffers) use an INTVAL before C<bufstart> for
-refcounting in DOD.
+refcounting in GC.
 
 =cut
 

Modified: trunk/src/gc/resources.c
==============================================================================
--- trunk/src/gc/resources.c	Thu Feb 12 11:39:41 2009	(r36627)
+++ trunk/src/gc/resources.c	Thu Feb 12 11:49:30 2009	(r36628)
@@ -239,10 +239,10 @@
     /* If not enough room, try to find some */
     if (pool->top_block->free < size) {
         /*
-         * force a DOD run to get live flags set
+         * force a GC mark run to get live flags set
          * for incremental M&S collection is run from there
          * but only if there may be something worth collecting!
-         * TODO pass required allocation size to the DOD system,
+         * TODO pass required allocation size to the GC system,
          *      so that collection can be skipped if needed
          */
         if (!interp->arena_base->gc_mark_block_level


More information about the parrot-commits mailing list