[svn:parrot] r41645 - branches/pcc_reapply/src/call

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Oct 3 21:00:53 UTC 2009


Author: bacek
Date: Sat Oct  3 21:00:49 2009
New Revision: 41645
URL: https://trac.parrot.org/parrot/changeset/41645

Log:
[care] Remove unused set_context_sig_params and _results functions

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

Modified: branches/pcc_reapply/src/call/pcc.c
==============================================================================
--- branches/pcc_reapply/src/call/pcc.c	Sat Oct  3 19:10:28 2009	(r41644)
+++ branches/pcc_reapply/src/call/pcc.c	Sat Oct  3 21:00:49 2009	(r41645)
@@ -151,27 +151,6 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*st);
 
-PARROT_CAN_RETURN_NULL
-static const char * set_context_sig_params(PARROT_INTERP,
-    ARGIN(const char *signature),
-    ARGMOD(INTVAL *n_regs_used),
-    ARGMOD(PMC **sigs),
-    ARGMOD(opcode_t **indexes),
-    ARGMOD(PMC *ctx),
-    ARGMOD(PMC *sig_obj))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        __attribute__nonnull__(5)
-        __attribute__nonnull__(6)
-        __attribute__nonnull__(7)
-        FUNC_MODIFIES(*n_regs_used)
-        FUNC_MODIFIES(*sigs)
-        FUNC_MODIFIES(*indexes)
-        FUNC_MODIFIES(*ctx)
-        FUNC_MODIFIES(*sig_obj);
-
 static void set_context_sig_returns(PARROT_INTERP,
     ARGMOD(PMC *ctx),
     ARGMOD(opcode_t **indexes),
@@ -185,18 +164,6 @@
         FUNC_MODIFIES(*indexes)
         FUNC_MODIFIES(*result_list);
 
-static void set_context_sig_returns_varargs(PARROT_INTERP,
-    ARGMOD(PMC *ctx),
-    ARGMOD(opcode_t **indexes),
-    ARGIN(const char *ret_x),
-    va_list returns)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3)
-        __attribute__nonnull__(4)
-        FUNC_MODIFIES(*ctx)
-        FUNC_MODIFIES(*indexes);
-
 static int set_retval_util(PARROT_INTERP,
     ARGIN(const char *sig),
     ARGIN(PMC *ctx),
@@ -2362,187 +2329,6 @@
 }
 
 
-/*
-
-=item C<static void set_context_sig_returns_varargs(PARROT_INTERP, PMC *ctx,
-opcode_t **indexes, const char *ret_x, va_list returns)>
-
-Sets the subroutine return arguments in the context C<ctx>. Takes a C string
-for the return signature C<ret_x> and a varargs list of return parameters
-C<returns>.
-
-To unify this function with C<set_context_sig_returns>, C<Parrot_PCCINVOKE>
-needs to be changed to convert the va_list of input arguments into a signature
-object, and the results list from that object needs to be passed to this
-function instead of the va_list itself.
-
-=cut
-
-*/
-
-static void
-set_context_sig_returns_varargs(PARROT_INTERP, ARGMOD(PMC *ctx),
-    ARGMOD(opcode_t **indexes), ARGIN(const char *ret_x), va_list returns)
-{
-    ASSERT_ARGS(set_context_sig_returns_varargs)
-    const char  *x;
-    unsigned int index      = 0;
-    unsigned int seen_arrow = 1;
-
-    /* result_accessors perform the arg accessor function,
-     * assigning the corresponding registers to the result variables */
-    for (x = ret_x; x && *x; x++) {
-        if (isupper((unsigned char)*x)) {
-            switch (*x) {
-                case 'I':
-                    {
-                    INTVAL * const tmpINTVAL = va_arg(returns, INTVAL *);
-                    *tmpINTVAL = CTX_REG_INT(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                case 'N':
-                    {
-                    FLOATVAL * const tmpFLOATVAL = va_arg(returns, FLOATVAL *);
-                    *tmpFLOATVAL = CTX_REG_NUM(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                case 'S':
-                    {
-                    STRING ** const tmpSTRING = va_arg(returns, STRING **);
-                    *tmpSTRING = CTX_REG_STR(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                case 'P':
-                    {
-                    PMC ** const tmpPMC = va_arg(returns, PMC **);
-                    *tmpPMC = CTX_REG_PMC(ctx, indexes[seen_arrow][index]);
-                    }
-                    break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Parrot_PCCINVOKE: invalid reg type %c!", *x);
-            }
-        }
-    }
-
-    Parrot_pop_context(interp);
-}
-
-/*
-
-=item C<static const char * set_context_sig_params(PARROT_INTERP, const char
-*signature, INTVAL *n_regs_used, PMC **sigs, opcode_t **indexes, PMC *ctx, PMC
-*sig_obj)>
-
-Sets the subroutine arguments in the C<ctx> context, according to the signature
-string C<signature>. Currently this function is only called from
-C<Parrot_pcc_invoke_from_sig_object>, but eventually when things are unified
-enough it should be called from C<Parrot_PCCINVOKE> as well. The only
-difference currently between the two implementations are the calls to
-C<commit_last_arg_sig_object> and C<commit_last_arg>.
-
-=cut
-
-*/
-
-PARROT_CAN_RETURN_NULL
-static const char *
-set_context_sig_params(PARROT_INTERP, ARGIN(const char *signature),
-    ARGMOD(INTVAL *n_regs_used), ARGMOD(PMC **sigs),
-    ARGMOD(opcode_t **indexes), ARGMOD(PMC *ctx),
-    ARGMOD(PMC *sig_obj))
-{
-    ASSERT_ARGS(set_context_sig_params)
-
-    const char *x;
-    const char *ret_x      = 0;
-    int         index      = -1;
-    int         seen_arrow = 0;
-    int         cur        = 0;
-
-    /* second loop through signature to build all index and arg_flag
-     * loop also assigns args(up to the ->) to registers */
-    for (x = signature; *x != '\0'; x++) {
-        /* detect -> separator */
-        if (*x == '-') {
-
-            /* skip '>' */
-            x++;
-
-            /* allows us to jump directly to the result signature portion
-             * during results assignment */
-            ret_x = x;
-
-            /* save off pointer to results */
-            ret_x++;
-
-            if (index >= 0)
-                commit_last_arg_sig_object(interp, index, cur, n_regs_used,
-                    seen_arrow, sigs, indexes, ctx, sig_obj);
-
-            /* reset parsing state so we can now handle results */
-            seen_arrow =  1;
-            index      = -1;
-
-            /* reset n_regs_used for reuse during result index allocation */
-            n_regs_used[0] = 0;
-            n_regs_used[1] = 0;
-            n_regs_used[2] = 0;
-            n_regs_used[3] = 0;
-        }
-        /* parse arg type */
-        else if (isupper((unsigned char)*x)) {
-            if (index >= 0)
-                commit_last_arg_sig_object(interp, index, cur, n_regs_used,
-                    seen_arrow, sigs, indexes, ctx, sig_obj);
-
-            index++;
-
-            switch (*x) {
-                case 'I': cur = PARROT_ARG_INTVAL;   break;
-                case 'N': cur = PARROT_ARG_FLOATVAL; break;
-                case 'S': cur = PARROT_ARG_STRING;   break;
-                case 'P': cur = PARROT_ARG_PMC;      break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Parrot_pcc_invoke_from_sig_object: "
-                        "invalid reg type %c!", *x);
-            }
-        }
-        /* parse arg adverbs */
-        else if (islower((unsigned char)*x)) {
-            switch (*x) {
-                case 'n': cur |= PARROT_ARG_NAME;         break;
-                case 'f': cur |= PARROT_ARG_FLATTEN;      break;
-                case 's': cur |= PARROT_ARG_SLURPY_ARRAY; break;
-                case 'o': cur |= PARROT_ARG_OPTIONAL;     break;
-                case 'p': cur |= PARROT_ARG_OPT_FLAG;     break;
-                case 'l': cur |= PARROT_ARG_LOOKAHEAD;    break;
-                case 'i': cur |= PARROT_ARG_INVOCANT;     break;
-                default:
-                    Parrot_ex_throw_from_c_args(interp, NULL,
-                        EXCEPTION_INVALID_OPERATION,
-                        "Parrot_pcc_invoke_from_sig_object: "
-                        "invalid adverb type %c!", *x);
-            }
-        }
-    }
-
-    if (index >= 0)
-        commit_last_arg_sig_object(interp, index, cur, n_regs_used,
-            seen_arrow, sigs, indexes, ctx, sig_obj);
-
-    interp->current_args   = indexes[0];
-    interp->args_signature = sigs[0];
-
-    Parrot_pcc_set_results(interp, ctx, indexes[1]);
-    Parrot_pcc_set_results_signature(interp, ctx, sigs[1]);
-
-    return ret_x;
-}
-
 
 /*
 


More information about the parrot-commits mailing list