[svn:parrot] r49307 - in branches/generational_gc: include/parrot src/gc

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Sep 25 00:58:00 UTC 2010


Author: bacek
Date: Sat Sep 25 00:57:59 2010
New Revision: 49307
URL: https://trac.parrot.org/parrot/changeset/49307

Log:
Add GC API write_barrier function

Modified:
   branches/generational_gc/include/parrot/gc_api.h
   branches/generational_gc/src/gc/api.c
   branches/generational_gc/src/gc/gc_private.h

Modified: branches/generational_gc/include/parrot/gc_api.h
==============================================================================
--- branches/generational_gc/include/parrot/gc_api.h	Sat Sep 25 00:57:41 2010	(r49306)
+++ branches/generational_gc/include/parrot/gc_api.h	Sat Sep 25 00:57:59 2010	(r49307)
@@ -162,6 +162,11 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
+void Parrot_gc_write_barrier(PARROT_INTERP, ARGIN(PMC *pmc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
 unsigned int Parrot_is_blocked_GC_mark(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -353,6 +358,9 @@
 #define ASSERT_ARGS_Parrot_gc_reallocate_memory_chunk_with_interior_pointers \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_gc_write_barrier __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc))
 #define ASSERT_ARGS_Parrot_is_blocked_GC_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_is_blocked_GC_sweep __attribute__unused__ int _ASSERT_ARGS_CHECK = (\

Modified: branches/generational_gc/src/gc/api.c
==============================================================================
--- branches/generational_gc/src/gc/api.c	Sat Sep 25 00:57:41 2010	(r49306)
+++ branches/generational_gc/src/gc/api.c	Sat Sep 25 00:57:59 2010	(r49307)
@@ -96,16 +96,6 @@
 
 /* HEADERIZER HFILE: include/parrot/gc_api.h */
 
-/* HEADERIZER BEGIN: static */
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-
-/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
-/* HEADERIZER END: static */
-
-#if ! DISABLE_GC_DEBUG
-
-#endif
-
 /*
 
 =item C<void Parrot_gc_mark_PObj_alive(PARROT_INTERP, PObj *obj)>
@@ -960,6 +950,24 @@
 
 /*
 
+=item C<void Parrot_gc_write_barrier(PARROT_INTERP, PMC *pmc)>
+
+Write barrier for PMC.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+void
+Parrot_gc_write_barrier(PARROT_INTERP, ARGIN(PMC *pmc))
+{
+    ASSERT_ARGS(Parrot_gc_write_barrier)
+    interp->gc_sys->write_barrier(interp, pmc);
+}
+
+/*
+
 =item C<void Parrot_gc_pmc_needs_early_collection(PARROT_INTERP, PMC *pmc)>
 
 Mark a PMC as needing timely destruction
@@ -1010,6 +1018,7 @@
     return name;
 }
 
+
 /*
 
 =back

Modified: branches/generational_gc/src/gc/gc_private.h
==============================================================================
--- branches/generational_gc/src/gc/gc_private.h	Sat Sep 25 00:57:41 2010	(r49306)
+++ branches/generational_gc/src/gc/gc_private.h	Sat Sep 25 00:57:59 2010	(r49307)
@@ -194,13 +194,12 @@
     /* Iterate over _live_ strings. Used for string pool compacting */
     void (*iterate_live_strings)(PARROT_INTERP, string_iterator_callback callback, void *data);
 
+    /* Write barrier */
+    void (*write_barrier)(PARROT_INTERP, PMC *);
+
     /* Statistic for GC */
     struct GC_Statistics stats;
 
-    /*Function hooks that GC systems can CHOOSE to provide if they need them
-     *These will be called via the GC API functions Parrot_gc_func_name
-     *e.g. read barrier && write barrier hooks can go here later ...*/
-
     /* Holds system-specific data structures */
     void * gc_private;
 } GC_Subsystem;


More information about the parrot-commits mailing list