develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35378 - in trunk: . config/gen/makefiles docs docs/pdds include/parrot lib/Parrot/Docs/Section src src/gc src/pmc src/stm

From:
allison
Date:
January 10, 2009 19:55
Subject:
[svn:parrot] r35378 - in trunk: . config/gen/makefiles docs docs/pdds include/parrot lib/Parrot/Docs/Section src src/gc src/pmc src/stm
Message ID:
20090111035541.CBE7BCB9FA@x12.develooper.com
Author: allison
Date: Sat Jan 10 19:55:39 2009
New Revision: 35378

Added:
   trunk/include/parrot/gc_api.h
      - copied unchanged from r35374, /branches/pdd09gc_part2/include/parrot/gc_api.h
   trunk/include/parrot/gc_mark_sweep.h
      - copied unchanged from r35374, /branches/pdd09gc_part2/include/parrot/gc_mark_sweep.h
   trunk/include/parrot/gc_pools.h
      - copied unchanged from r35374, /branches/pdd09gc_part2/include/parrot/gc_pools.h
   trunk/src/gc/api.c
      - copied unchanged from r35374, /branches/pdd09gc_part2/src/gc/api.c
   trunk/src/gc/gc_malloc.c
      - copied unchanged from r35374, /branches/pdd09gc_part2/src/gc/gc_malloc.c
   trunk/src/gc/generational_ms.c
      - copied unchanged from r35374, /branches/pdd09gc_part2/src/gc/generational_ms.c
   trunk/src/gc/incremental_ms.c
      - copied unchanged from r35374, /branches/pdd09gc_part2/src/gc/incremental_ms.c
   trunk/src/gc/mark_sweep.c
      - copied unchanged from r35374, /branches/pdd09gc_part2/src/gc/mark_sweep.c
   trunk/src/gc/pools.c
      - copied unchanged from r35374, /branches/pdd09gc_part2/src/gc/pools.c
Removed:
   trunk/include/parrot/dod.h
   trunk/include/parrot/headers.h
   trunk/include/parrot/smallobject.h
   trunk/src/gc/dod.c
   trunk/src/gc/gc_gms.c
   trunk/src/gc/gc_ims.c
   trunk/src/gc/smallobject.c
   trunk/src/headers.c
Modified:
   trunk/MANIFEST
   trunk/config/gen/makefiles/root.in
   trunk/docs/debug.pod
   trunk/docs/memory_internals.pod
   trunk/docs/pmc.pod
   trunk/include/parrot/parrot.h
   trunk/include/parrot/settings.h
   trunk/lib/Parrot/Docs/Section/C.pm
   trunk/src/cpu_dep.c
   trunk/src/gc/resources.c
   trunk/src/inter_run.c
   trunk/src/pmc.c
   trunk/src/pmc/array.pmc
   trunk/src/pmc/deleg_pmc.pmc
   trunk/src/pmc/integer.pmc
   trunk/src/stacks.c
   trunk/src/stm/backend.c
   trunk/src/thread.c

Changes in other areas also in this revision:
Modified:
   trunk/docs/pdds/pdd09_gc.pod

Log:
[pdd09gc] Merging the pdd09gc_part2 branch into trunk for r34686 to r35374.
GC refactor: reorganize code for sanity and maintainability.


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	(original)
+++ trunk/MANIFEST	Sat Jan 10 19:55:39 2009
@@ -902,7 +902,8 @@
 include/parrot/compiler.h                                   [main]include
 include/parrot/datatypes.h                                  [main]include
 include/parrot/debugger.h                                   [main]include
-include/parrot/dod.h                                        [main]include
+include/parrot/gc_api.h                                     [main]include
+include/parrot/gc_mark_sweep.h                              [main]include
 include/parrot/dynext.h                                     [main]include
 include/parrot/embed.h                                      [main]include
 include/parrot/encoding.h                                   [main]include
@@ -915,7 +916,7 @@
 include/parrot/global.h                                     [main]include
 include/parrot/global_setup.h                               [main]include
 include/parrot/hash.h                                       [main]include
-include/parrot/headers.h                                    [main]include
+include/parrot/gc_pools.h                                   [main]include
 include/parrot/hll.h                                        [main]include
 include/parrot/imcc.h                                       [main]include
 include/parrot/inter_call.h                                 [main]include
@@ -949,7 +950,7 @@
 include/parrot/scheduler_private.h                          [main]include
 include/parrot/settings.h                                   [main]include
 include/parrot/slice.h                                      [main]include
-include/parrot/smallobject.h                                [main]include
+include/parrot/gc_mark_sweep.h                              [main]include
 include/parrot/stacks.h                                     [main]include
 include/parrot/stat.h                                       [main]include
 include/parrot/stm/backend.h                                [main]include
@@ -2966,18 +2967,19 @@
 src/exec_start.c                                            []
 src/exit.c                                                  []
 src/extend.c                                                []
-src/gc/dod.c                                                []
-src/gc/gc_gms.c                                             []
-src/gc/gc_ims.c                                             []
+src/gc/api.c                                                []
+src/gc/gc_malloc.c                                          []
+src/gc/generational_ms.c                                    []
+src/gc/incremental_ms.c                                     []
 src/gc/memory.c                                             []
 src/gc/register.c                                           []
 src/gc/res_lea.c                                            []
 src/gc/resources.c                                          []
-src/gc/smallobject.c                                        []
+src/gc/mark_sweep.c                                         []
 src/global.c                                                []
 src/global_setup.c                                          []
 src/hash.c                                                  []
-src/headers.c                                               []
+src/gc/pools.c                                              []
 src/hll.c                                                   []
 src/inter_call.c                                            []
 src/inter_cb.c                                              []

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	(original)
+++ trunk/config/gen/makefiles/root.in	Sat Jan 10 19:55:39 2009
@@ -383,16 +383,16 @@
     $(SRC_DIR)/exit$(O) \
     $(SRC_DIR)/extend$(O) \
     $(SRC_DIR)/extend_vtable$(O) \
-    $(SRC_DIR)/gc/dod$(O) \
-    $(SRC_DIR)/gc/gc_gms$(O) \
-    $(SRC_DIR)/gc/gc_ims$(O) \
+    $(SRC_DIR)/gc/api$(O) \
+    $(SRC_DIR)/gc/generational_ms$(O) \
+    $(SRC_DIR)/gc/incremental_ms$(O) \
     $(SRC_DIR)/gc/memory$(O) \
+    $(SRC_DIR)/gc/pools$(O) \
     $(SRC_DIR)/gc/register$(O) \
-    $(SRC_DIR)/gc/smallobject$(O) \
+    $(SRC_DIR)/gc/mark_sweep$(O) \
     $(SRC_DIR)/global$(O) \
     $(SRC_DIR)/global_setup$(O) \
     $(SRC_DIR)/hash$(O) \
-    $(SRC_DIR)/headers$(O) \
     $(SRC_DIR)/hll$(O) \
     $(SRC_DIR)/inter_call$(O)  \
     $(SRC_DIR)/inter_cb$(O)  \
@@ -1069,20 +1069,20 @@
 
 $(SRC_DIR)/key$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/key.str
 
-$(SRC_DIR)/gc/smallobject$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/gc/mark_sweep$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/gc/dod$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/gc/api$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/gc/gc_ims$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/gc/generational_ms$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/gc/gc_gms$(O) : $(GENERAL_H_FILES)
+$(SRC_DIR)/gc/incremental_ms$(O) : $(GENERAL_H_FILES)
+
+$(SRC_DIR)/gc/pools$(O) : $(GENERAL_H_FILES)
 
 $(SRC_DIR)/gc/resources$(O) : $(GENERAL_H_FILES)
 
 $(SRC_DIR)/gc/res_lea$(O) : $(GENERAL_H_FILES)
 
-$(SRC_DIR)/headers$(O) : $(GENERAL_H_FILES)
-
 $(SRC_DIR)/hll$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/hll.str
 
 $(SRC_DIR)/platform$(O) : $(GENERAL_H_FILES)

Modified: trunk/docs/debug.pod
==============================================================================
--- trunk/docs/debug.pod	(original)
+++ trunk/docs/debug.pod	Sat Jan 10 19:55:39 2009
@@ -58,17 +58,17 @@
 garbage collector.
 
 Within the C<--gc-debug> mode, there is another tool to help narrow down the
-problem. You can edit F<src/gc/dod.c> and C<#define> the C<GC_VERBOSE> flag to 1.
-After recompiling C<parrot>, the garbage collector will perform additional
+problem. You can edit F<src/gc/api.c> and C<#define> the C<GC_VERBOSE> flag to
+1.  After recompiling C<parrot>, the garbage collector will perform additional
 checks. After the garbage collector has traced all objects to find which ones
 are still alive, it will scan through all of the dead objects to see if any of
 them believe they are alive (which will happen for infants, since they come
-into existence marked live.) If it finds any, it will print them out. You can
-then re-run the program with a breakpoint set on the routine that allocated the
-object (e.g. C<get_free_object> in F<src/gc/smallobject.c>).  You'll probably want
-to make the breakpoint conditional on the object having the version number that
-was reported, because the same memory location will probably hold many
-different objects over the lifetime of the program.
+into existence marked live.) If it finds any, it will print them out.
+You can then re-run the program with a breakpoint set on the routine that
+allocated the object (e.g. C<get_free_object> in F<src/gc/mark_sweep.c>).
+You'll probably want to make the breakpoint conditional on the object having
+the version number that was reported, because the same memory location will
+probably hold many different objects over the lifetime of the program.
 
 =head1 PIR AND PASM CODE
 

Modified: trunk/docs/memory_internals.pod
==============================================================================
--- trunk/docs/memory_internals.pod	(original)
+++ trunk/docs/memory_internals.pod	Sat Jan 10 19:55:39 2009
@@ -258,9 +258,9 @@
 
 =head1 FILES
 
-smallobject.[ch], headers.c, resources.[ch], res_lea.c, dod.c, string.[ch],
-pobj.h. Other garbage collector implementations may use separate files as
-well.
+mark_sweep.[ch], src/gc/pools.c, resources.[ch], res_lea.c, src/gc/api.c,
+string.[ch], pobj.h. Other garbage collector implementations may use separate
+files as well.
 
 =head1 BUGS
 

Modified: trunk/docs/pmc.pod
==============================================================================
--- trunk/docs/pmc.pod	(original)
+++ trunk/docs/pmc.pod	Sat Jan 10 19:55:39 2009
@@ -94,7 +94,7 @@
 
 =head1 SEE ALSO
 
-F<include/parrot/pobj.h>, F<src/dod.c>, F<docs/pdds/pdd02_vtables.pod>
+F<include/parrot/pobj.h>, F<src/gc/api.c>, F<docs/pdds/pdd02_vtables.pod>
 
 =head1 AUTHOR
 

Modified: trunk/include/parrot/parrot.h
==============================================================================
--- trunk/include/parrot/parrot.h	(original)
+++ trunk/include/parrot/parrot.h	Sat Jan 10 19:55:39 2009
@@ -297,9 +297,9 @@
 #include "parrot/pmc.h"
 #include "parrot/events.h"
 #include "parrot/intlist.h"
-#include "parrot/smallobject.h"
-#include "parrot/headers.h"
-#include "parrot/dod.h"
+#include "parrot/gc_api.h"
+#include "parrot/gc_mark_sweep.h"
+#include "parrot/gc_pools.h"
 #include "parrot/resources.h"
 #include "parrot/string_funcs.h"
 #include "parrot/misc.h"

Modified: trunk/include/parrot/settings.h
==============================================================================
--- trunk/include/parrot/settings.h	(original)
+++ trunk/include/parrot/settings.h	Sat Jan 10 19:55:39 2009
@@ -27,7 +27,7 @@
 
 /* Helpful internal macro for testing whether we are currently
  * debugging garbage collection and memory management. See also the
- * definition of GC_VERBOSE in dod.c. */
+ * definition of GC_VERBOSE in src/gc/api.c. */
 #if DISABLE_GC_DEBUG
 #  define GC_DEBUG(interp) 0
 #else

Modified: trunk/lib/Parrot/Docs/Section/C.pm
==============================================================================
--- trunk/lib/Parrot/Docs/Section/C.pm	(original)
+++ trunk/lib/Parrot/Docs/Section/C.pm	Sat Jan 10 19:55:39 2009
@@ -235,7 +235,7 @@
                 'pairs'   => ['resources'],
                 'sources' => ['res_lea']
             ),
-            $self->c_pair_item( '', 'smallobject' ),
+            $self->c_pair_item( '', 'mark_sweep' ),
             $self->c_pair_item( '', 'headers' ),
         ),
         $self->new_group(

Modified: trunk/src/cpu_dep.c
==============================================================================
--- trunk/src/cpu_dep.c	(original)
+++ trunk/src/cpu_dep.c	Sat Jan 10 19:55:39 2009
@@ -14,7 +14,7 @@
 directly or stores it on the system stack. C<trace_system_stack>
 sets up a trace of the system stack using two marker addresses as
 boundaries. The code to actually perform the trace of a memory block
-between two boundaries is located in C<src/gc/dod.c:trace_mem_block>.
+between two boundaries is located in C<src/gc/api.c:trace_mem_block>.
 
 =head2 Functions
 
@@ -26,7 +26,7 @@
 
 #include "parrot/parrot.h"
 
-/* HEADERIZER HFILE: include/parrot/dod.h */
+/* HEADERIZER HFILE: include/parrot/gc_api.h */
 
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
@@ -169,7 +169,7 @@
 
 =head1 SEE ALSO
 
-F<src/gc/dod.c> and F<include/parrot/dod.h>.
+F<src/gc/api.c> and F<include/parrot/gc_api.h>.
 
 =cut
 

Modified: trunk/src/gc/resources.c
==============================================================================
--- trunk/src/gc/resources.c	(original)
+++ trunk/src/gc/resources.c	Sat Jan 10 19:55:39 2009
@@ -378,7 +378,7 @@
     ++arena_base->GC_block_level;
 
     if (interp->profile)
-        Parrot_dod_profile_start(interp);
+        Parrot_gc_profile_start(interp);
 
     /* We're collecting */
     arena_base->mem_allocs_since_last_collect    = 0;
@@ -579,7 +579,7 @@
     pool->possibly_reclaimable   = 0;
 
     if (interp->profile)
-        Parrot_dod_profile_end(interp, PARROT_PROF_GC);
+        Parrot_gc_profile_end(interp, PARROT_PROF_GC);
 
     --arena_base->GC_block_level;
 }

Modified: trunk/src/inter_run.c
==============================================================================
--- trunk/src/inter_run.c	(original)
+++ trunk/src/inter_run.c	Sat Jan 10 19:55:39 2009
@@ -146,7 +146,7 @@
     PMC * const ret_c    = new_ret_continuation_pmc(interp, NULL);
     interp->current_cont = ret_c;
 #if defined GC_VERBOSE && GC_VERBOSE
-    PObj_report_SET(ret_c);     /* s. also dod.c */
+    PObj_report_SET(ret_c);     /* s. also src/gc/api.c */
 #endif
     /* invoke the sub, which places the context of the sub in the
      * interpreter, and switches code segments if needed

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c	(original)
+++ trunk/src/pmc.c	Sat Jan 10 19:55:39 2009
@@ -197,7 +197,7 @@
     }
     else {
         if (has_ext)
-            Parrot_free_pmc_ext(interp, pmc);
+            Parrot_gc_free_pmc_ext(interp, pmc);
 
 #if ! PMC_DATA_IN_EXT
         PMC_data(pmc) = NULL;
@@ -302,7 +302,7 @@
     pmc            = new_pmc_header(interp, flags);
     pmc->vtable    = vtable;
 
-#ifdef GC_VERBOSE
+#if GC_VERBOSE
     if (Interp_flags_TEST(interp, PARROT_TRACE_FLAG)) {
         /* XXX make a more verbose trace flag */
         fprintf(stderr, "\t=> new %p type %d\n", pmc, (int)base_type);
@@ -491,7 +491,7 @@
         VTABLE_destroy(interp, pmc);
 
     if (PObj_is_PMC_EXT_TEST(pmc))
-        Parrot_free_pmc_ext(interp, pmc);
+        Parrot_gc_free_pmc_ext(interp, pmc);
 
     PObj_flags_SETTO((PObj *)pmc, PObj_on_free_list_FLAG);
     pool->add_free_object(interp, pool, (PObj *)pmc);
@@ -662,7 +662,7 @@
     }
     else {
         if (PObj_is_PMC_EXT_TEST(_class))
-            Parrot_free_pmc_ext(interp, _class);
+            Parrot_gc_free_pmc_ext(interp, _class);
 
         DOD_flag_CLEAR(is_special_PMC, _class);
 

Modified: trunk/src/pmc/array.pmc
==============================================================================
--- trunk/src/pmc/array.pmc	(original)
+++ trunk/src/pmc/array.pmc	Sat Jan 10 19:55:39 2009
@@ -121,9 +121,9 @@
     void class_init() {
         /* class_init_code; called for side effects */
         Small_Object_Pool *List_chunks =
-            make_bufferlike_pool(INTERP, sizeof (List_chunk));
+            get_bufferlike_pool(INTERP, sizeof (List_chunk));
         Small_Object_Pool *Lists       =
-            make_bufferlike_pool(INTERP, sizeof (List));
+            get_bufferlike_pool(INTERP, sizeof (List));
 
         /* XXX until there's a function to allocate a pool in an arena */
         UNUSED(List_chunks);

Modified: trunk/src/pmc/deleg_pmc.pmc
==============================================================================
--- trunk/src/pmc/deleg_pmc.pmc	(original)
+++ trunk/src/pmc/deleg_pmc.pmc	Sat Jan 10 19:55:39 2009
@@ -45,7 +45,7 @@
         /* don't pass that on
          *
          * NB objects have the flag PObj_data_is_PMC_array_FLAG set,
-         * marking is done internally in src/dod.c
+         * marking is done internally in src/gc/api.c
          */
     }
 

Modified: trunk/src/pmc/integer.pmc
==============================================================================
--- trunk/src/pmc/integer.pmc	(original)
+++ trunk/src/pmc/integer.pmc	Sat Jan 10 19:55:39 2009
@@ -67,12 +67,10 @@
 */
 
 VTABLE PMC *instantiate(PMC *sig) {
-    PMC * const ret    = new_pmc_header(INTERP, 0);
+    PMC * const ret    = pmc_new(INTERP, VTABLE_type(INTERP, SELF));
     opcode_t   *arg_op = interp->current_args;
     INTVAL      init   = 0;
 
-    ret->vtable        = interp->vtables[SELF->vtable->base_type];
-
     if (SIG_ELEMS(sig) == 2) {
         switch (SIG_ITEM(sig, 1)) {
             case PARROT_ARG_I:
@@ -89,7 +87,7 @@
         }
     }
 
-    PMC_int_val(ret) = init;
+    VTABLE_set_integer_native(INTERP, ret, init);
     return ret;
 }
 

Modified: trunk/src/stacks.c
==============================================================================
--- trunk/src/stacks.c	(original)
+++ trunk/src/stacks.c	Sat Jan 10 19:55:39 2009
@@ -103,7 +103,7 @@
 new_stack(PARROT_INTERP, ARGIN(const char *name))
 {
     ASSERT_ARGS(new_stack)
-    Small_Object_Pool * const pool = make_bufferlike_pool(interp, sizeof (Stack_Chunk_t));
+    Small_Object_Pool * const pool = get_bufferlike_pool(interp, sizeof (Stack_Chunk_t));
     Stack_Chunk_t     * const chunk = (Stack_Chunk_t *)(pool->get_free_object)(interp, pool);
 
     chunk->prev = chunk;        /* mark the top of the stack */

Modified: trunk/src/stm/backend.c
==============================================================================
--- trunk/src/stm/backend.c	(original)
+++ trunk/src/stm/backend.c	Sat Jan 10 19:55:39 2009
@@ -298,7 +298,7 @@
     Small_Object_Pool *ignored;
     STM_TRACE("Parrot_STM_alloc");
 
-    ignored = make_bufferlike_pool(interp, sizeof (Parrot_STM_PMC_handle_data));
+    ignored = get_bufferlike_pool(interp, sizeof (Parrot_STM_PMC_handle_data));
     UNUSED(ignored);
     handle = (Parrot_STM_PMC_handle_data *)new_bufferlike_header(interp,
                 sizeof (Parrot_STM_PMC_handle_data));

Modified: trunk/src/thread.c
==============================================================================
--- trunk/src/thread.c	(original)
+++ trunk/src/thread.c	Sat Jan 10 19:55:39 2009
@@ -1263,7 +1263,7 @@
     /* mark and sweep our world -- later callbacks will keep
      * it sync'd
      */
-    Parrot_dod_ms_run(interp, GC_trace_stack_FLAG);
+    Parrot_gc_ms_run(interp, GC_trace_stack_FLAG);
 
     PARROT_ASSERT(!(interp->thread_data->state & THREAD_STATE_SUSPENDED_GC));
 }



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About