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

[svn:parrot] r35570 - in trunk: include/parrot src/gc

From:
Whiteknight
Date:
January 14, 2009 16:32
Subject:
[svn:parrot] r35570 - in trunk: include/parrot src/gc
Message ID:
20090115003235.AFC92CB9AE@x12.develooper.com
Author: Whiteknight
Date: Wed Jan 14 16:32:34 2009
New Revision: 35570

Modified:
   trunk/include/parrot/gc_mark_sweep.h
   trunk/include/parrot/inter_call.h
   trunk/include/parrot/packfile.h
   trunk/src/gc/mark_sweep.c

Log:
[GC] Remove Parrot_gc_trace_pmc_data(), it's unused now that nothing is using the PObj_data_is_PMC_array_FLAG flag.

Modified: trunk/include/parrot/gc_mark_sweep.h
==============================================================================
--- trunk/include/parrot/gc_mark_sweep.h	(original)
+++ trunk/include/parrot/gc_mark_sweep.h	Wed Jan 14 16:32:34 2009
@@ -202,10 +202,6 @@
 int Parrot_gc_trace_children(PARROT_INTERP, size_t how_many)
         __attribute__nonnull__(1);
 
-void Parrot_gc_trace_pmc_data(PARROT_INTERP, ARGIN(PMC *p))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 int Parrot_gc_trace_root(PARROT_INTERP, Parrot_gc_trace_type trace)
         __attribute__nonnull__(1);
 
@@ -250,9 +246,6 @@
     || PARROT_ASSERT_ARG(pool)
 #define ASSERT_ARGS_Parrot_gc_trace_children __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_Parrot_gc_trace_pmc_data __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(p)
 #define ASSERT_ARGS_Parrot_gc_trace_root __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_is_const_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: trunk/include/parrot/inter_call.h
==============================================================================
--- trunk/include/parrot/inter_call.h	(original)
+++ trunk/include/parrot/inter_call.h	Wed Jan 14 16:32:34 2009
@@ -299,16 +299,22 @@
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(src_ctx) \
     || PARROT_ASSERT_ARG(dest_ctx)
-#define ASSERT_ARGS_Parrot_pcc_invoke_sub_from_c_args \
+#define ASSERT_ARGS_Parrot_pcc_invoke_from_sig_object \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(sub_obj) \
-    || PARROT_ASSERT_ARG(sig)
-#define ASSERT_ARGS_Parrot_pcc_invoke_sub_from_sig_object \
+    || PARROT_ASSERT_ARG(sig_obj)
+#define ASSERT_ARGS_Parrot_pcc_invoke_method_from_c_args \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pmc) \
+    || PARROT_ASSERT_ARG(method_name) \
+    || PARROT_ASSERT_ARG(signature)
+#define ASSERT_ARGS_Parrot_pcc_invoke_sub_from_c_args \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(sub_obj) \
-    || PARROT_ASSERT_ARG(sig_obj)
+    || PARROT_ASSERT_ARG(sig)
 #define ASSERT_ARGS_Parrot_PCCINVOKE __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(pmc) \

Modified: trunk/include/parrot/packfile.h
==============================================================================
--- trunk/include/parrot/packfile.h	(original)
+++ trunk/include/parrot/packfile.h	Wed Jan 14 16:32:34 2009
@@ -393,6 +393,34 @@
         FUNC_MODIFIES(*dir);
 
 PARROT_EXPORT
+void PackFile_Annotations_add_entry(PARROT_INTERP,
+    ARGMOD(struct PackFile_Annotations *self),
+    opcode_t offset,
+    opcode_t key,
+    opcode_t type,
+    opcode_t value)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*self);
+
+PARROT_EXPORT
+void PackFile_Annotations_add_group(PARROT_INTERP,
+    ARGMOD(struct PackFile_Annotations *self),
+    opcode_t offset)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*self);
+
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+PackFile_Segment * PackFile_Annotations_new(PARROT_INTERP,
+    ARGIN(struct PackFile *pf),
+    SHIM(const char *name),
+    NULLOK(int add))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
 void PackFile_Constant_destroy(SHIM_INTERP,
     ARGMOD_NULLOK(PackFile_Constant *self))
         FUNC_MODIFIES(*self);
@@ -686,25 +714,6 @@
 void mark_const_subs(PARROT_INTERP)
         __attribute__nonnull__(1);
 
-PARROT_EXPORT
-void PackFile_Annotations_add_entry(PARROT_INTERP,
-    ARGMOD(struct PackFile_Annotations *self),
-    opcode_t offset,
-    opcode_t key,
-    opcode_t type,
-    opcode_t value)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*self);
-
-PARROT_EXPORT
-void PackFile_Annotations_add_group(PARROT_INTERP,
-    ARGMOD(struct PackFile_Annotations *self),
-    opcode_t offset)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        FUNC_MODIFIES(*self);
-
 void PackFile_Annotations_destroy(SHIM_INTERP,
     ARGMOD(struct PackFile_Segment *seg))
         __attribute__nonnull__(2)
@@ -723,15 +732,6 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-PackFile_Segment * PackFile_Annotations_new(PARROT_INTERP,
-    ARGIN(struct PackFile *pf),
-    SHIM(const char *name),
-    NULLOK(int add))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 PARROT_CANNOT_RETURN_NULL
 opcode_t * PackFile_Annotations_pack(PARROT_INTERP,
     ARGIN(struct PackFile_Segment *seg),
@@ -761,6 +761,17 @@
 #define ASSERT_ARGS_PackFile_add_segment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(dir) \
     || PARROT_ASSERT_ARG(seg)
+#define ASSERT_ARGS_PackFile_Annotations_add_entry \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(self)
+#define ASSERT_ARGS_PackFile_Annotations_add_group \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(self)
+#define ASSERT_ARGS_PackFile_Annotations_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(pf)
 #define ASSERT_ARGS_PackFile_Constant_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
 #define ASSERT_ARGS_PackFile_Constant_new __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
 #define ASSERT_ARGS_PackFile_Constant_pack_size __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -871,14 +882,6 @@
     || PARROT_ASSERT_ARG(self)
 #define ASSERT_ARGS_mark_const_subs __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_PackFile_Annotations_add_entry \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Annotations_add_group \
-     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(self)
 #define ASSERT_ARGS_PackFile_Annotations_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(seg)
 #define ASSERT_ARGS_PackFile_Annotations_dump __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -887,9 +890,6 @@
 #define ASSERT_ARGS_PackFile_Annotations_lookup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(self)
-#define ASSERT_ARGS_PackFile_Annotations_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(pf)
 #define ASSERT_ARGS_PackFile_Annotations_pack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(seg) \

Modified: trunk/src/gc/mark_sweep.c
==============================================================================
--- trunk/src/gc/mark_sweep.c	(original)
+++ trunk/src/gc/mark_sweep.c	Wed Jan 14 16:32:34 2009
@@ -956,8 +956,6 @@
     const int      lazy_dod   = arena_base->lazy_dod;
     PMC           *current    = arena_base->dod_mark_start;
 
-    const UINTVAL mask = PObj_data_is_PMC_array_FLAG | PObj_custom_mark_FLAG;
-
     /*
      * First phase of mark is finished. Now if we are the owner
      * of a shared pool, we must run the mark phase of other
@@ -973,7 +971,6 @@
     pt_DOD_mark_root_finished(interp);
 
     do {
-        const UINTVAL bits = PObj_get_FLAGS(current) & mask;
         PMC *next;
 
         if (lazy_dod && arena_base->num_early_PMCs_seen >=
@@ -994,17 +991,9 @@
         if (PMC_metadata(current))
             pobject_lives(interp, (PObj *)PMC_metadata(current));
 
-        /* Start by checking if there's anything at all. This assumes that the
-         * largest percentage of PMCs won't have anything in their data
-         * pointer that we need to trace. */
-        if (bits) {
-            if (bits == PObj_data_is_PMC_array_FLAG)
-                Parrot_gc_trace_pmc_data(interp, current);
-            else {
-                /* All that's left is the custom */
-                PARROT_ASSERT(!PObj_on_free_list_TEST(current));
-                VTABLE_mark(interp, current);
-            }
+         if(PObj_custom_mark_TEST(current)) {
+            PARROT_ASSERT(!PObj_on_free_list_TEST(current));
+            VTABLE_mark(interp, current);
         }
 
         next = PMC_next_for_GC(current);
@@ -1024,37 +1013,6 @@
     return 1;
 }
 
-
-/*
-
-=item C<void Parrot_gc_trace_pmc_data>
-
-If the PMC is an array of PMCs, trace all elements in the array as children.
-Touches each object in the array to mark it as being alive. To determine
-whether a PMC is an array to be marked in this way, it is tested for the
-C<PObj_data_is_PMC_array_FLAG> flag.
-
-=cut
-
-*/
-
-void
-Parrot_gc_trace_pmc_data(PARROT_INTERP, ARGIN(PMC *p))
-{
-    ASSERT_ARGS(Parrot_gc_trace_pmc_data)
-    /* malloced array of PMCs */
-    PMC ** const data = PMC_data_typed(p, PMC **);
-
-    if (data) {
-        INTVAL i;
-
-        for (i = PMC_int_val(p) - 1; i >= 0; --i)
-            if (data[i])
-                pobject_lives(interp, (PObj *)data[i]);
-    }
-}
-
-
 /*
 
 =item C<void Parrot_add_to_free_list>



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