[svn:parrot] r48231 - in trunk: docs/pdds include/parrot src/call
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Fri Jul 30 18:51:57 UTC 2010
Author: NotFound
Date: Fri Jul 30 18:51:57 2010
New Revision: 48231
URL: https://trac.parrot.org/parrot/changeset/48231
Log:
kill Parrot_PCCINVOKE
Modified:
trunk/docs/pdds/pdd27_multiple_dispatch.pod
trunk/include/parrot/call.h
trunk/src/call/pcc.c
Modified: trunk/docs/pdds/pdd27_multiple_dispatch.pod
==============================================================================
--- trunk/docs/pdds/pdd27_multiple_dispatch.pod Fri Jul 30 17:35:11 2010 (r48230)
+++ trunk/docs/pdds/pdd27_multiple_dispatch.pod Fri Jul 30 18:51:57 2010 (r48231)
@@ -207,11 +207,7 @@
=item Parrot_mmd_invoke
-Make a multiple dispatch call. Similar in syntax to C<Parrot_PCCINVOKE>, but
-doesn't separate out the invocant before the signature since the call can have
-multiple invocants. A significant part of the code from C<Parrot_PCCINVOKE>
-can be factored out to helper routines used by both C<Parrot_PCCINVOKE> and
-C<Parrot_mmd_invoke>.
+Make a multiple dispatch call.
void
Parrot_mmd_invoke(PARROT_INTERP, NOTNULL(STRING *sub_name),
Modified: trunk/include/parrot/call.h
==============================================================================
--- trunk/include/parrot/call.h Fri Jul 30 17:35:11 2010 (r48230)
+++ trunk/include/parrot/call.h Fri Jul 30 18:51:57 2010 (r48231)
@@ -87,18 +87,6 @@
__attribute__nonnull__(2)
__attribute__nonnull__(3);
-PARROT_EXPORT
-void Parrot_PCCINVOKE(PARROT_INTERP,
- ARGIN(PMC* pmc),
- ARGMOD(STRING *method_name),
- ARGIN(const char *signature),
- ...)
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3)
- __attribute__nonnull__(4)
- FUNC_MODIFIES(*method_name);
-
#define ASSERT_ARGS_Parrot_pcc_do_run_ops __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(sub_obj))
@@ -118,11 +106,6 @@
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(sub_obj) \
, PARROT_ASSERT_ARG(sig))
-#define ASSERT_ARGS_Parrot_PCCINVOKE __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp) \
- , PARROT_ASSERT_ARG(pmc) \
- , PARROT_ASSERT_ARG(method_name) \
- , PARROT_ASSERT_ARG(signature))
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/call/pcc.c */
Modified: trunk/src/call/pcc.c
==============================================================================
--- trunk/src/call/pcc.c Fri Jul 30 17:35:11 2010 (r48230)
+++ trunk/src/call/pcc.c Fri Jul 30 18:51:57 2010 (r48231)
@@ -58,57 +58,15 @@
=item C<void Parrot_pcc_invoke_sub_from_c_args(PARROT_INTERP, PMC *sub_obj,
const char *sig, ...)>
-Follows the same conventions as C<Parrot_PCCINVOKE>, but the subroutine object
-to invoke is passed as an argument rather than looked up by name. The signature
-string and call arguments are converted to a CallSignature PMC.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-void
-Parrot_pcc_invoke_sub_from_c_args(PARROT_INTERP, ARGIN(PMC *sub_obj),
- ARGIN(const char *sig), ...)
-{
- ASSERT_ARGS(Parrot_pcc_invoke_sub_from_c_args)
- PMC *call_obj;
- va_list args;
- const char *arg_sig, *ret_sig;
- PMC * const old_call_obj =
- Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
-
- Parrot_pcc_split_signature_string(sig, &arg_sig, &ret_sig);
-
- va_start(args, sig);
- call_obj = Parrot_pcc_build_call_from_varargs(interp, PMCNULL,
- arg_sig, &args);
- Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_obj);
- Parrot_pcc_invoke_from_sig_object(interp, sub_obj, call_obj);
- call_obj = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
- Parrot_pcc_fill_params_from_varargs(interp, call_obj, ret_sig, &args,
- PARROT_ERRORS_RESULT_COUNT_FLAG);
- va_end(args);
- Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_call_obj);
-}
-
-
-/*
-
-=item C<void Parrot_PCCINVOKE(PARROT_INTERP, PMC* pmc, STRING *method_name,
-const char *signature, ...)>
+C<pmc> is the invocant.
-DEPRECATED. See TT #443. Use Parrot_pcc_invoke_method_from_c_args instead.
+C<sub_obj> is the sub to invoke.
-C<pmc> is the invocant.
+C<sig> is the signature.
-C<method_name> is the same C<method_name> used in the C<find_method>
-VTABLE call
+Variable args contains the IN arguments followed by the OUT results variables.
+You must pass the address_of(&) the OUT results, of course.
-C<signature> is a C string describing the Parrot calling conventions for
-Parrot_PCCINVOKE. ... variable args contains the IN arguments followed
-by the OUT results variables. You must pass the address_of(&) the OUT
-results, of course.
Signatures:
uppercase letters repesent each arg and denote its types
@@ -147,7 +105,6 @@
a FLOATVAL: N
a slurpy PMC: Ps
-invokes a PMC method
=cut
@@ -155,25 +112,28 @@
PARROT_EXPORT
void
-Parrot_PCCINVOKE(PARROT_INTERP, ARGIN(PMC* pmc), ARGMOD(STRING *method_name),
- ARGIN(const char *signature), ...)
+Parrot_pcc_invoke_sub_from_c_args(PARROT_INTERP, ARGIN(PMC *sub_obj),
+ ARGIN(const char *sig), ...)
{
- ASSERT_ARGS(Parrot_PCCINVOKE)
- PMC *sig_obj;
- PMC *sub_obj;
- va_list args;
- va_start(args, signature);
- sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, pmc, signature, args);
- va_end(args);
+ ASSERT_ARGS(Parrot_pcc_invoke_sub_from_c_args)
+ PMC *call_obj;
+ va_list args;
+ const char *arg_sig, *ret_sig;
+ PMC * const old_call_obj =
+ Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
- /* Find the subroutine object as a named method on pmc */
- sub_obj = VTABLE_find_method(interp, pmc, method_name);
- if (PMC_IS_NULL(sub_obj))
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_METHOD_NOT_FOUND,
- "Method '%Ss' not found", method_name);
+ Parrot_pcc_split_signature_string(sig, &arg_sig, &ret_sig);
- /* Invoke the subroutine object with the given CallSignature object */
- Parrot_pcc_invoke_from_sig_object(interp, sub_obj, sig_obj);
+ va_start(args, sig);
+ call_obj = Parrot_pcc_build_call_from_varargs(interp, PMCNULL,
+ arg_sig, &args);
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), call_obj);
+ Parrot_pcc_invoke_from_sig_object(interp, sub_obj, call_obj);
+ call_obj = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp));
+ Parrot_pcc_fill_params_from_varargs(interp, call_obj, ret_sig, &args,
+ PARROT_ERRORS_RESULT_COUNT_FLAG);
+ va_end(args);
+ Parrot_pcc_set_signature(interp, CURRENT_CONTEXT(interp), old_call_obj);
}
@@ -329,9 +289,8 @@
=item C<void Parrot_pcc_invoke_from_sig_object(PARROT_INTERP, PMC *sub_obj, PMC
*call_object)>
-Follows the same conventions as C<Parrot_PCCINVOKE>, but the subroutine object
-to invoke is passed as an argument rather than looked up by name, and the
-signature string and call arguments are passed in a CallSignature PMC.
+Follows the same conventions as C<Parrot_pcc_invoke_method_from_c_args>, but
+the signature string and call arguments are passed in a CallSignature PMC.
=cut
More information about the parrot-commits
mailing list