* src/mm/cacao-gc/mark.c: Added MARK() as helper macro.
authormichi <none@none>
Wed, 28 Feb 2007 16:35:25 +0000 (16:35 +0000)
committermichi <none@none>
Wed, 28 Feb 2007 16:35:25 +0000 (16:35 +0000)
--HG--
branch : exact-gc

src/mm/cacao-gc/mark.c
src/vm/jit/codegen-common.c

index 679de392635c4bf003c5f167e227f741f9d82877..7728b5b6733c337e81bd9d72a1d460924bc807d0 100644 (file)
 
 #include "config.h"
 
-#if defined(ENABLE_THREADS)
-# include "threads/native/threads.h"
-#else
-/*# include "threads/none/threads.h"*/
-#endif
-
 #include "gc.h"
 #include "final.h"
 #include "heap.h"
 #include "vmcore/linker.h"
 
 
+/* Helper Macros **************************************************************/
+
+#define MARK(o) \
+       GCSTAT_COUNT_MAX(gcstat_mark_depth, gcstat_mark_depth_max); \
+       mark_recursive(o); \
+       GCSTAT_DEC(gcstat_mark_depth);
+
+
 /* mark_recursive **************************************************************
 
    Recursively mark all objects (including this) which are referenced.
@@ -208,7 +210,7 @@ void mark_classes(void *start, void *end)
                                continue;
 
                        /* mark the reference */
-                       mark_recursive(ref);
+                       MARK(ref);
 
                }
 
@@ -245,8 +247,7 @@ void mark_me(rootset_t *rs)
        while (rs) {
                GC_LOG( dolog("GC: Marking from rootset (%d entries) ...", rs->refcount); );
 
-               /* recursively mark all references of the rootset */
-               GCSTAT_COUNT_MAX(gcstat_mark_depth, gcstat_mark_depth_max);
+               /* mark all references of the rootset */
                for (i = 0; i < rs->refcount; i++) {
 
                        /* is this a marking reference? */
@@ -255,10 +256,9 @@ void mark_me(rootset_t *rs)
 
                        /* do the marking here */
                        ref = *( rs->refs[i] );
-                       mark_recursive(ref);
+                       MARK(ref);
 
                }
-               GCSTAT_DEC(gcstat_mark_depth);
 
                rs = rs->next;
        }
@@ -280,7 +280,7 @@ void mark_me(rootset_t *rs)
                        fe->type = FINAL_RECLAIMABLE;
 
                        /* keep the object alive until finalizer finishes */
-                       mark_recursive(ref);
+                       MARK(ref);
 
                        /* notify the finalizer after collection finished */
                        gc_notify_finalizer = true;
@@ -293,7 +293,7 @@ void mark_me(rootset_t *rs)
                                        heap_print_object(ref); printf("\n"); );
 
                        /* keep the object alive until finalizer finishes */
-                       mark_recursive(ref);
+                       MARK(ref);
                } else
 
                /* object not marked, but was not finalized yet */
@@ -302,7 +302,7 @@ void mark_me(rootset_t *rs)
                                        heap_print_object(ref); printf("\n"); );
 
                        /* keep the object alive until finalizer finishes */
-                       mark_recursive(ref);
+                       MARK(ref);
                } else
 
                /* object marked, but finalizer already ran */
index 7496334bfe433a2e565c69c267835dc137db518b..f46d0d9cab33ec174a5b454e736fc4d823593f6f 100644 (file)
@@ -39,7 +39,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen-common.c 7407 2007-02-26 19:12:03Z michi $
+   $Id: codegen-common.c 7403 2007-02-25 21:31:58Z pm $
 
 */