[svn:parrot] r46776 - in trunk/src: . pmc

plobsing at svn.parrot.org plobsing at svn.parrot.org
Wed May 19 02:57:10 UTC 2010


Author: plobsing
Date: Wed May 19 02:57:10 2010
New Revision: 46776
URL: https://trac.parrot.org/parrot/changeset/46776

Log:
move freeze/thaw calls adjacent to visit calls.

the fact that this is possible suggests we should eliminate either visit or freeze/thaw. I prefer to eliminate freeze/thaw.

Modified:
   trunk/src/pmc/imageio.pmc
   trunk/src/pmc/imageiosize.pmc
   trunk/src/pmc/imageiostrings.pmc
   trunk/src/pmc_freeze.c

Modified: trunk/src/pmc/imageio.pmc
==============================================================================
--- trunk/src/pmc/imageio.pmc	Wed May 19 01:14:38 2010	(r46775)
+++ trunk/src/pmc/imageio.pmc	Wed May 19 02:57:10 2010	(r46776)
@@ -273,7 +273,6 @@
                 PObj_flag_CLEAR(private1, info);
 
             pmc = Parrot_pmc_new_noinit(interp, type);
-            VTABLE_thaw(interp, pmc, info);
 
             VTABLE_set_pmc_keyed_int(interp, todo, id - 1, pmc);
         }
@@ -330,7 +329,6 @@
 
         parrot_hash_put(interp, hash, pmc, (void *)id);
         VTABLE_push_pmc(interp, PARROT_IMAGEIO(info)->todo, pmc);
-        VTABLE_freeze(interp, pmc, info);
     }
 }
 
@@ -687,7 +685,7 @@
         VTABLE_set_pointer(INTERP, PARROT_IMAGEIO(SELF)->seen,
             parrot_new_intval_hash(INTERP));
 
-        visit_todo_list_freeze(INTERP, p, SELF);
+        STATICSELF.push_pmc(p);
         Parrot_visit_loop_visit(INTERP, SELF);
     }
 
@@ -715,7 +713,7 @@
                     EXCEPTION_INVALID_STRING_REPRESENTATION,
                     "PackFile header failed during unpack");
 
-        unused = visit_todo_list_thaw(INTERP, SELF);
+        unused = STATICSELF.shift_pmc();
         Parrot_visit_loop_visit(INTERP, SELF);
 
         /* we're done reading the image */

Modified: trunk/src/pmc/imageiosize.pmc
==============================================================================
--- trunk/src/pmc/imageiosize.pmc	Wed May 19 01:14:38 2010	(r46775)
+++ trunk/src/pmc/imageiosize.pmc	Wed May 19 02:57:10 2010	(r46776)
@@ -59,7 +59,6 @@
 
         VTABLE_push_integer(interp, info, pmc->vtable->base_type);
         VTABLE_push_pmc(interp, PARROT_IMAGEIOSIZE(info)->todo, pmc);
-        VTABLE_freeze(interp, pmc, info);
     }
 }
 

Modified: trunk/src/pmc/imageiostrings.pmc
==============================================================================
--- trunk/src/pmc/imageiostrings.pmc	Wed May 19 01:14:38 2010	(r46775)
+++ trunk/src/pmc/imageiostrings.pmc	Wed May 19 02:57:10 2010	(r46776)
@@ -170,7 +170,6 @@
                 /* not yet seen */
                 parrot_hash_put(INTERP, hash, v, v);
                 VTABLE_push_pmc(INTERP, PARROT_IMAGEIOSTRINGS(SELF)->todo, v);
-                VTABLE_freeze(INTERP, v, SELF);
             }
         }
     }

Modified: trunk/src/pmc_freeze.c
==============================================================================
--- trunk/src/pmc_freeze.c	Wed May 19 01:14:38 2010	(r46775)
+++ trunk/src/pmc_freeze.c	Wed May 19 02:57:10 2010	(r46776)
@@ -324,6 +324,7 @@
     ASSERT_ARGS(Parrot_visit_loop_visit)
 
     INTVAL      i;
+    const INTVAL action = VTABLE_get_integer(interp, info);
     PMC * const todo    = VTABLE_get_iter(interp, info);
 
     /* can't cache upper limit, visit may append items */
@@ -335,6 +336,11 @@
 
         PARROT_ASSERT(current->vtable);
 
+        if (action == VISIT_FREEZE_NORMAL)
+            VTABLE_freeze(interp, current, info);
+        else
+            VTABLE_thaw(interp, current, info);
+
         VTABLE_visit(interp, current, info);
 
         VISIT_PMC(interp, info, PMC_metadata(current));


More information about the parrot-commits mailing list