Author: petdance
Date: Sat Jun 9 17:30:27 2007
New Revision: 18899
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/dod.h
trunk/src/gc/dod.c
Log:
* Fixed dod.h headers.
* Inlined the conditional macro vs. func #define for pobject_lives()
so that it's always a function call, with #ifdeffed guts.
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Sat Jun 9 17:30:27 2007
@@ -1829,6 +1829,7 @@
# Slowing working my way up to having everything headerized in
$(HEADERIZER_O_FILES)
HEADERIZER_O_FILES = \
src/datatypes.o \
+ src/gc/dod.o \
src/gc/memory.o \
src/gc/register.o \
src/gc/resources.o \
Modified: trunk/include/parrot/dod.h
==============================================================================
--- trunk/include/parrot/dod.h (original)
+++ trunk/include/parrot/dod.h Sat Jun 9 17:30:27 2007
@@ -51,53 +51,69 @@
set, i.e. registers */
};
-PARROT_API void Parrot_do_dod_run(Interp *, UINTVAL flags);
-void trace_system_areas(Interp *);
-void trace_mem_block(Interp *, size_t, size_t);
-
-void free_unused_pobjects(Interp *interp,
- struct Small_Object_Pool *pool);
-
-void used_cow(Interp *interp,
- struct Small_Object_Pool *pool, int cleanup);
-void clear_cow(Interp *interp,
- struct Small_Object_Pool *pool, int cleanup);
+/* HEADERIZER BEGIN: src/gc/dod.c */
-/* mark a PObj live during DOD */
+PARROT_API void Parrot_do_dod_run( Interp *interp /*NN*/, UINTVAL flags )
+ __attribute__nonnull__(1);
-#if PARROT_GC_GMS
-# define pobject_lives(i, o) do { \
- if (!PObj_live_TEST(o) && \
- PObj_to_GMSH(o)->gen->gen_no >= i->gc_generation) \
- parrot_gc_gms_pobject_lives(i, o); \
- } while (0)
+PARROT_API void Parrot_dod_clear_live_bits( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
-PARROT_API void parrot_gc_gms_pobject_lives(Interp *interp, PObj *obj);
+PARROT_API void Parrot_dod_ms_run( Interp *interp /*NN*/, int flags )
+ __attribute__nonnull__(1);
-#else
-PARROT_API void pobject_lives(Interp *interp, PObj *buffer);
-#endif
+PARROT_API void Parrot_dod_ms_run_init( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+PARROT_API void Parrot_dod_profile_end( Interp *interp /*NN*/, int what )
+ __attribute__nonnull__(1);
+
+PARROT_API void Parrot_dod_profile_start( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+PARROT_API void Parrot_dod_sweep( Interp *interp /*NN*/,
+ Small_Object_Pool *pool /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+PARROT_API int Parrot_dod_trace_children( Interp *interp /*NN*/,
+ size_t how_many )
+ __attribute__nonnull__(1);
+
+PARROT_API int Parrot_dod_trace_root( Interp *interp /*NN*/, int trace_stack )
+ __attribute__nonnull__(1);
+
+void clear_cow( Interp *interp, Small_Object_Pool *pool /*NN*/, int cleanup )
+ __attribute__nonnull__(2);
+
+void pobject_lives( Interp *interp /*NN*/, PObj *obj /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+void trace_mem_block( Interp *interp /*NN*/,
+ size_t lo_var_ptr,
+ size_t hi_var_ptr )
+ __attribute__nonnull__(1);
+
+void used_cow( Interp *interp, Small_Object_Pool *pool /*NN*/, int cleanup )
+ __attribute__nonnull__(2);
+
+/* HEADERIZER END: src/gc/dod.c */
+
+/* XXX Needs to go into another header */
+void trace_system_areas(Interp *interp /*NN*/);
#if ! DISABLE_GC_DEBUG
/* Set when walking the system stack */
extern int CONSERVATIVE_POINTER_CHASING;
#endif
-PARROT_API int Parrot_dod_trace_root(Interp *, int trace_stack);
-PARROT_API int Parrot_dod_trace_children(Interp *, size_t how_many);
-PARROT_API void Parrot_dod_sweep(Interp *, struct Small_Object_Pool *pool);
-PARROT_API void Parrot_dod_ms_run_init(Interp *interp);
-PARROT_API void Parrot_dod_clear_live_bits(Interp*);
-
-PARROT_API void Parrot_dod_profile_start(Parrot_Interp interp);
-PARROT_API void Parrot_dod_profile_end(Parrot_Interp interp, int what);
/* GC subsystem init functions */
+PARROT_API void parrot_gc_gms_pobject_lives(Interp *interp, PObj *obj);
PARROT_API void Parrot_gc_ms_init(Interp *interp);
PARROT_API void Parrot_gc_ims_init(Interp *interp);
PARROT_API void Parrot_gc_gms_init(Interp *interp);
-/* do_dod_run function for MS */
-PARROT_API void Parrot_dod_ms_run(Interp *interp, int flags);
PARROT_API void Parrot_dod_ims_wb(Interp*, PMC *, PMC *);
/*
Modified: trunk/src/gc/dod.c
==============================================================================
--- trunk/src/gc/dod.c (original)
+++ trunk/src/gc/dod.c Sat Jun 9 17:30:27 2007
@@ -130,12 +130,16 @@
}
}
-#if !PARROT_GC_GMS
-
-/* XXX This should really use the same header, with different guts #ifdeffed */
void
pobject_lives(Interp *interp /*NN*/, PObj *obj /*NN*/)
{
+#if PARROT_GC_GMS
+ do {
+ if (!PObj_live_TEST(obj) && \
+ PObj_to_GMSH(obj)->gen->gen_no >= interp->gc_generation) \
+ parrot_gc_gms_pobject_lives(interp, obj); \
+ } while (0);
+#else /* not PARROT_GC_GMS */
/* if object is live or on free list return */
if (PObj_is_live_or_free_TESTALL(obj)) {
return;
@@ -180,9 +184,8 @@
obj, PObj_bufstart((Buffer*) obj));
}
# endif
-}
-
#endif /* PARROT_GC_GMS */
+}
/*
@@ -199,6 +202,7 @@
*/
+PARROT_API
int
Parrot_dod_trace_root(Interp *interp /*NN*/, int trace_stack)
{
@@ -332,6 +336,7 @@
*/
+PARROT_API
int
Parrot_dod_trace_children(Interp *interp /*NN*/, size_t how_many)
{
@@ -521,6 +526,7 @@
*/
+PARROT_API
void
Parrot_dod_sweep(Interp *interp /*NN*/, Small_Object_Pool *pool /*NN*/)
{
@@ -805,6 +811,7 @@
}
+PARROT_API
void
Parrot_dod_clear_live_bits(Interp *interp /*NN*/)
{
@@ -820,6 +827,7 @@
*/
+PARROT_API
void
Parrot_dod_profile_start(Interp *interp /*NN*/)
{
@@ -836,6 +844,7 @@
*/
+PARROT_API
void
Parrot_dod_profile_end(Interp *interp /*NN*/, int what)
{
@@ -867,6 +876,7 @@
*/
+PARROT_API
void
Parrot_dod_ms_run_init(Interp *interp /*NN*/)
{
@@ -911,6 +921,7 @@
*/
+PARROT_API
void
Parrot_dod_ms_run(Interp *interp /*NN*/, int flags)
{