[svn:parrot] r40578 - branches/pcc_arg_unify/src/call
allison at svn.parrot.org
allison at svn.parrot.org
Sun Aug 16 04:26:08 UTC 2009
Author: allison
Date: Sun Aug 16 04:26:05 2009
New Revision: 40578
URL: https://trac.parrot.org/parrot/changeset/40578
Log:
[pcc] Remove two static functions that are no longer used.
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 Sun Aug 16 04:14:20 2009 (r40577)
+++ branches/pcc_arg_unify/src/call/pcc.c Sun Aug 16 04:26:05 2009 (r40578)
@@ -3207,117 +3207,6 @@
/*
-=item C<static Parrot_Context * count_signature_elements(PARROT_INTERP, const
-char *signature, PMC *args_sig, PMC *results_sig, int flag)>
-
-Counts the number of each type of register in a signature object. Returns
-the total number of parameter arguments, the total number of result
-arguments, and the number of each type needed for register allocation.
-Adds the necessary registers to a new context and returns the context.
-
-=cut
-
-*/
-
-PARROT_CANNOT_RETURN_NULL
-static Parrot_Context *
-count_signature_elements(PARROT_INTERP, ARGIN(const char *signature),
- ARGMOD(PMC *args_sig), ARGMOD(PMC *results_sig), int flag)
-{
- ASSERT_ARGS(count_signature_elements)
- const char *x;
- unsigned int seen_arrow = 0;
-
- /*Count of number of each type of arg and result, INSP->INSP */
- int max_regs[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
- /* variables from PCCINVOKE impl in PCCMETHOD.pm */
- /* args INSP, returns INSP */
- INTVAL n_regs_used[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
-
- /* # of args, # of results */
- int arg_ret_cnt[2] = { 0, 0 };
-
- /* Increment these values if we are not calling from a CallSignature
- PMC */
- if (flag) {
- arg_ret_cnt[seen_arrow]++;
- max_regs[REGNO_PMC]++;
- }
-
- /* Loop through the signature string to count the number of each
- type of object required. We need to know so we can allocate
- an appropriate number of registers for it. */
- for (x = signature; *x != '\0'; x++) {
- switch (*x) {
- case '-':
- /* detect -> separator */
- seen_arrow = 1;
- ++x;
- if (*x != '>')
- Parrot_ex_throw_from_c_args(interp, NULL,
- EXCEPTION_INVALID_OPERATION,
- "PCCINVOKE: invalid signature separator %c!",
- *x);
- break;
- case 'I':
- arg_ret_cnt[seen_arrow]++;
- max_regs[seen_arrow * 4 + REGNO_INT]++;
- break;
- case 'N':
- arg_ret_cnt[seen_arrow]++;
- max_regs[seen_arrow * 4 + REGNO_NUM]++;
- break;
- case 'S':
- arg_ret_cnt[seen_arrow]++;
- max_regs[seen_arrow * 4 + REGNO_STR]++;
- break;
- case 'P':
- arg_ret_cnt[seen_arrow]++;
- {
- /* Lookahead to see if PMC is marked as invocant */
- if (*(++x) == 'i') {
- max_regs[REGNO_PMC]++;
- }
- else {
- x--; /* Undo lookahead */
- max_regs[seen_arrow * 4 + REGNO_PMC]++;
- }
- }
- break;
- case 'f':
- case 'n':
- case 's':
- case 'o':
- case 'p':
- /* case 'l': */ /* lookahead parameter */
- case 'i':
- break;
- default:
- Parrot_ex_throw_from_c_args(interp, NULL,
- EXCEPTION_INVALID_OPERATION,
- "Parrot_PCCINVOKE: invalid reg type %c!", *x);
- }
- }
-
- /* calculate max reg types needed for both args and results */
- n_regs_used[0] = PARROT_MAX(max_regs[0], max_regs[4]);
- n_regs_used[1] = PARROT_MAX(max_regs[1], max_regs[5]);
- n_regs_used[2] = PARROT_MAX(max_regs[2], max_regs[6]);
- n_regs_used[3] = PARROT_MAX(max_regs[3], max_regs[7]);
-
- /* initialize arg and return sig FIAs with collected info */
- if (arg_ret_cnt[0] > 0)
- VTABLE_set_integer_native(interp, args_sig, arg_ret_cnt[0]);
-
- if (arg_ret_cnt[1] > 0)
- VTABLE_set_integer_native(interp, results_sig, arg_ret_cnt[1]);
-
- return Parrot_push_context(interp, n_regs_used);
-}
-
-/*
-
=item C<static void commit_last_arg_sig_object(PARROT_INTERP, int index, int
cur, opcode_t *n_regs_used, int seen_arrow, PMC * const *sigs, opcode_t
**indexes, Parrot_Context *ctx, PMC *sig_obj)>
@@ -3473,71 +3362,6 @@
/*
-=item C<static void set_context_sig_returns_varargs(PARROT_INTERP,
-Parrot_Context *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(Parrot_Context *ctx),
- ARGMOD(opcode_t **indexes), ARGIN(const char *ret_x), va_list returns)
-{
- ASSERT_ARGS(set_context_sig_returns_varargs)
- unsigned int index = 0;
- unsigned int seen_arrow = 1;
- const char *x;
-
- /* 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 void parse_signature_string(PARROT_INTERP, const char *signature,
PMC **arg_flags, PMC **return_flags)>
More information about the parrot-commits
mailing list