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

[svn:parrot] r35453 - trunk/src

From:
chromatic
Date:
January 12, 2009 11:45
Subject:
[svn:parrot] r35453 - trunk/src
Message ID:
20090112194428.36393CB9F9@x12.develooper.com
Author: chromatic
Date: Mon Jan 12 11:44:27 2009
New Revision: 35453

Modified:
   trunk/src/inter_call.c

Log:
[src] Removed some PMC DOD registration from invoke code.  If PObjs are getting
collected while they're only available from the stack, we have a problem.  If
weird errors occur, this is the first commit to consider reverting.

Modified: trunk/src/inter_call.c
==============================================================================
--- trunk/src/inter_call.c	(original)
+++ trunk/src/inter_call.c	Mon Jan 12 11:44:27 2009
@@ -559,8 +559,6 @@
         st->key              = pmc_new(interp, enum_class_Key);
         PMC_int_val(st->key) = 0;
         PMC_data(st->key)    = (void *)INITBucketIndex;
-
-        dod_register_pmc(interp, st->key);
     }
     else {
         /* src ought to be an array */
@@ -654,7 +652,6 @@
                 UVal_pmc(st->val) = CONTEXT(interp)->current_object;
             else {
                 UVal_pmc(st->val) = va_arg(*ap, PMC *);
-                dod_register_pmc(interp, UVal_pmc(st->val));
             }
 
             if (st->src.sig & PARROT_ARG_FLATTEN) {
@@ -670,9 +667,6 @@
                 st->src.used = 1;
                 retval       = Parrot_fetch_arg(interp, st);
 
-                if (!PMC_IS_NULL(st->key))
-                    dod_unregister_pmc(interp, st->key);
-
                 return retval;
             }
             break;
@@ -738,9 +732,6 @@
                 st->src.used = 1;
                 retval       = Parrot_fetch_arg(interp, st);
 
-                if (!PMC_IS_NULL(st->key))
-                    dod_unregister_pmc(interp, st->key);
-
                 return retval;
             }
             break;
@@ -803,9 +794,6 @@
         if (st->src.slurp_i == st->src.slurp_n) {
             st->src.mode &= ~CALL_STATE_FLATTEN;
 
-            if (!PMC_IS_NULL(st->key))
-                dod_unregister_pmc(interp, st->key);
-
             st->key = PMCNULL;
             st->src.i++;
         }
@@ -866,7 +854,6 @@
         }
 
         UVal_pmc(st->val) = slurped;
-        dod_register_pmc(interp, slurped);
     }
     else {
         Parrot_fetch_arg(interp, st);
@@ -906,7 +893,6 @@
 
             VTABLE_set_integer_native(interp, d, UVal_int(st->val));
             UVal_pmc(st->val) = d;
-            dod_register_pmc(interp, d);
             }
             break;
         default:
@@ -942,7 +928,6 @@
 
             VTABLE_set_number_native(interp, d, UVal_num(st->val));
             UVal_pmc(st->val) = d;
-            dod_register_pmc(interp, d);
             }
             break;
         default:
@@ -979,7 +964,6 @@
 
             VTABLE_set_string_native(interp, d, UVal_str(st->val));
             UVal_pmc(st->val) = d;
-            dod_register_pmc(interp, d);
             }
             break;
         default:
@@ -1143,7 +1127,6 @@
              * otherwise it may get collected. */
             st->dest.slurp = pmc_new(interp,
                 Parrot_get_ctx_HLL_type(interp, enum_class_Hash));
-            dod_register_pmc(interp, st->dest.slurp);
 
             /* pass the slurpy hash */
             idx = st->dest.u.op.pc[i];
@@ -1611,7 +1594,6 @@
 
         /* Must register this PMC or it may get collected when only the struct
          * references it. */
-        dod_register_pmc(interp, array);
         CTX_REG_PMC(st->dest.ctx, idx) = array;
 
         while (Parrot_fetch_arg(interp, st)) {
@@ -1629,7 +1611,6 @@
         }
 
         dest->i++;
-        dod_unregister_pmc(interp, array);
     }
 
     /* is there another argument? if we're throwing errors, that's an error */
@@ -1681,10 +1662,6 @@
     }
 
     check_named(interp, st);
-
-    /* we may or may not have registered this pmc */
-    if (dest->slurp)
-        dod_unregister_pmc(interp, dest->slurp);
 }
 
 
@@ -1776,8 +1753,6 @@
 
     /* If we created a slurpy, we had to DOD register it so it did not get
      * collected during arg processing; we'll now unregister it. */
-    if (st.dest.slurp)
-        dod_unregister_pmc(interp, st.dest.slurp);
 }
 
 
@@ -1873,7 +1848,6 @@
         case 'P':
             if (set_retval_util(interp, "P", ctx, &st)) {
                 PMC *retval = UVal_pmc(st.val);
-                dod_unregister_pmc(interp, retval);
                 return (void *)retval;
             }
         default:
@@ -2521,7 +2495,6 @@
     va_end(args);
 
     Parrot_pcc_invoke_from_sig_object(interp, sub_obj, sig_obj);
-    dod_unregister_pmc(interp, sig_obj);
 }
 
 /*



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