[svn:parrot] r40720 - branches/pcc_arg_unify/src/call

tene at svn.parrot.org tene at svn.parrot.org
Sat Aug 22 20:49:49 UTC 2009


Author: tene
Date: Sat Aug 22 20:49:47 2009
New Revision: 40720
URL: https://trac.parrot.org/parrot/changeset/40720

Log:
[pcc] revert the slurpy return patch.  It wasn't right.

Modified:
   branches/pcc_arg_unify/src/call/pcc.c

Modified: branches/pcc_arg_unify/src/call/pcc.c
==============================================================================
--- branches/pcc_arg_unify/src/call/pcc.c	Sat Aug 22 19:12:01 2009	(r40719)
+++ branches/pcc_arg_unify/src/call/pcc.c	Sat Aug 22 20:49:47 2009	(r40720)
@@ -1321,10 +1321,8 @@
     PMC * const caller_return_flags = VTABLE_get_attr_str(interp, call_object, CONST_STRING(interp, "return_flags"));
     INTVAL raw_return_count     = VTABLE_elements(interp, raw_sig);
     INTVAL return_index = 0;
-    INTVAL return_list_index = 0; /* index into the results... can be different in the presence of slurpies and friends */
+    INTVAL return_list_index = 0;
     INTVAL err_check      = 0;
-    INTVAL filling_slurpy = 0;
-    PMC *slurpy_collection = PMCNULL;
 
     /* Check if we should be throwing errors. This is configured separately
      * for parameters and return values. */
@@ -1366,13 +1364,6 @@
         result_flags = VTABLE_get_pmc_keyed_int(interp, caller_return_flags, return_list_index);
         item_sig = VTABLE_get_string_keyed_str(interp, result_item, CONST_STRING(interp, ''));
 
-        /* If we're returning into a slurpy, set up a collection to hold the returns */
-        if (result_flags & PARROT_ARG_SLURPY_ARRAY && filling_slurpy == 0) {
-            filling_slurpy = 1;
-            slurpy_collection = pmc_new(interp,
-                    Parrot_get_ctx_HLL_type(interp, enum_class_ResizablePMCArray));
-        }
-
         switch (PARROT_ARG_TYPE_MASK_MASK(return_flags)) {
             case PARROT_ARG_INTVAL:
                 if (Parrot_str_equal(interp, item_sig, CONST_STRING(interp, "P"))) {
@@ -1382,6 +1373,7 @@
                     VTABLE_set_integer_native(interp, result_item, raw_index);
                 else
                     VTABLE_set_integer_native(interp, result_item, CTX_REG_INT(ctx, raw_index));
+                return_list_index++;
                 break;
             case PARROT_ARG_FLOATVAL:
                 if (Parrot_str_equal(interp, item_sig, CONST_STRING(interp, "P"))) {
@@ -1392,6 +1384,7 @@
                             ctx->constants[raw_index]->u.number);
                 else
                     VTABLE_set_number_native(interp, result_item, CTX_REG_NUM(ctx, raw_index));
+                return_list_index++;
                 break;
             case PARROT_ARG_STRING:
                 if (Parrot_str_equal(interp, item_sig, CONST_STRING(interp, "P"))) {
@@ -1402,34 +1395,20 @@
                                         ctx->constants[raw_index]->u.string));
                 else
                     VTABLE_set_string_native(interp, result_item, CTX_REG_STR(ctx, raw_index));
+                return_list_index++;
                 break;
             case PARROT_ARG_PMC:
                 if (constant)
                     VTABLE_set_pmc(interp, result_item, ctx->constants[raw_index]->u.key);
                 else
                     VTABLE_set_pmc(interp, result_item, CTX_REG_PMC(ctx, raw_index));
+                return_list_index++;
                 break;
             default:
                 Parrot_ex_throw_from_c_args(interp, NULL,
                         EXCEPTION_INVALID_OPERATION, "invalid parameter type");
                 break;
         }
-
-        /* If we're filling a slurpy, pull out the saved item and insert it into the collection */
-        if (filling_slurpy > 0) {
-            PMC *item = VTABLE_get_pmc(interp, result_item);
-            VTABLE_push_pmc(interp, slurpy_collection, item);
-            /* this check is WRONG... but close enough for now */
-            if (return_index + 1 == raw_return_count) {
-                VTABLE_set_pmc(interp, result_item, slurpy_collection);
-                filling_slurpy = 0;
-                return_list_index++;
-            }
-        }
-        else {
-            return_list_index++;
-        }
-
     }
 }
 


More information about the parrot-commits mailing list