Author: Whiteknight
Date: Wed Aug 13 18:22:29 2008
New Revision: 30215

Modified:
   branches/gsoc_pdd09/src/gc/gc_it.c
   branches/gsoc_pdd09/src/ops/pmc.ops
   branches/gsoc_pdd09/src/vtables.c

Log:
[gsoc_pdd09] a few diagnostics and changes to hunt down a strange dead pmc 
error.

Modified: branches/gsoc_pdd09/src/gc/gc_it.c
==============================================================================
--- branches/gsoc_pdd09/src/gc/gc_it.c  (original)
+++ branches/gsoc_pdd09/src/gc/gc_it.c  Wed Aug 13 18:22:29 2008
@@ -264,8 +264,8 @@
         return;
     }
 #  if GC_IT_DEBUG
-    fprintf(stderr, "GC Run. items total: %d, flags: %x, state: %d\n",
-            (int)gc_priv_data->total_count, flags, gc_priv_data->state);
+    //fprintf(stderr, "GC Run. items total: %d, flags: %x, state: %d\n",
+    //        (int)gc_priv_data->total_count, flags, gc_priv_data->state);
 #  endif
 
     /* items scanned this run */
@@ -588,14 +588,15 @@
                   these function calls.
             */
             mark = gc_it_get_card_mark(hdr);
-
             if (mark == GC_IT_CARD_WHITE) {
                 PObj * pobj = IT_HDR_to_PObj(hdr);
                 if (PObj_needs_early_DOD_TEST(pobj))
                     --interp->arena_base->num_early_DOD_PMCs;
-                gc_it_add_free_header(interp, pool, hdr);
-                Parrot_dod_free_pmc(interp, pool, IT_HDR_to_PObj(hdr));
-                ++pool->num_free_objects;
+                if (!PObj_constant_TEST(pobj)) {
+                    gc_it_add_free_header(interp, pool, hdr);
+                    Parrot_dod_free_pmc(interp, pool, IT_HDR_to_PObj(hdr));
+                    ++pool->num_free_objects;
+                }
             }
             else if (mark == GC_IT_CARD_BLACK) {
                 gc_it_set_card_mark(hdr, GC_IT_CARD_WHITE);
@@ -730,13 +731,16 @@
     /* If the queue is not currently empty, trace through it real quick so
        we don't lose anything. This is probably not the right way to go, but
        it should work. */
-    if (gc_priv_data->queue)
+    if (gc_priv_data->queue) {
+        fprintf(stderr, "Objects on queue before root queue. Tracing.\n");
         gc_it_trace_normal(interp);
+    }
 
     PARROT_ASSERT(!gc_priv_data->queue);
     /* Move the entire root queue to the queue */
     gc_priv_data->queue       = gc_priv_data->root_queue;
     gc_priv_data->root_queue  = NULL;
+    fprintf(stderr, "Root queue added to queue\n");
 }
 #  endif
 

Modified: branches/gsoc_pdd09/src/ops/pmc.ops
==============================================================================
--- branches/gsoc_pdd09/src/ops/pmc.ops (original)
+++ branches/gsoc_pdd09/src/ops/pmc.ops Wed Aug 13 18:22:29 2008
@@ -86,8 +86,10 @@
     STRING * const classname = $2;
     PMC * const classobj = Parrot_oo_get_class_str(interp, classname);
 
-    if (!PMC_IS_NULL(classobj))
+    if (!PMC_IS_NULL(classobj)) {
+        fprintf(stderr, "Instantiating class from %p\n", classobj);
         $1 = VTABLE_instantiate(interp, classobj, PMCNULL);
+    }
     else {
         const INTVAL type = pmc_type(interp, classname);
         if (type <= 0)

Modified: branches/gsoc_pdd09/src/vtables.c
==============================================================================
--- branches/gsoc_pdd09/src/vtables.c   (original)
+++ branches/gsoc_pdd09/src/vtables.c   Wed Aug 13 18:22:29 2008
@@ -67,7 +67,6 @@
         parrot_hash_clone(interp, base_vtable->isa_hash, new_vtable->isa_hash);
     }
 
-
     return new_vtable;
 }
 
@@ -210,8 +209,12 @@
             pobject_lives(interp, (PObj *)vtable->whoami);
         if (vtable->provides_str)
             pobject_lives(interp, (PObj *)vtable->provides_str);
-        if (vtable->pmc_class)
+        if (vtable->pmc_class) {
+            fprintf(stderr, "Marking class pmc %p\n", vtable->pmc_class);
             pobject_lives(interp, (PObj *)vtable->pmc_class);
+        } else {
+            fprintf(stderr, "vtable has no class pmc!\n");
+        }
     }
 }
 

Reply via email to