[svn:parrot] r43615 - in trunk: docs docs/pdds/draft include/parrot src

coke at svn.parrot.org coke at svn.parrot.org
Wed Jan 27 03:39:58 UTC 2010


Author: coke
Date: Wed Jan 27 03:39:51 2010
New Revision: 43615
URL: https://trac.parrot.org/parrot/changeset/43615

Log:
remove deprecated Parrot_call_method (TT #1145)

Modified:
   trunk/docs/embed.pod
   trunk/docs/extend.pod
   trunk/docs/pdds/draft/pdd11_extending.pod
   trunk/include/parrot/extend.h
   trunk/src/extend.c

Modified: trunk/docs/embed.pod
==============================================================================
--- trunk/docs/embed.pod	Wed Jan 27 03:32:26 2010	(r43614)
+++ trunk/docs/embed.pod	Wed Jan 27 03:39:51 2010	(r43615)
@@ -601,8 +601,6 @@
 
 =item C<Parrot_ext_call>
 
-=item [DEPRECATED] C<Parrot_call_method>
-
 =item [DEPRECATED] C<Parrot_call_sub>
 
 =item [DEPRECATED] C<Parrot_call_sub_ret_float>

Modified: trunk/docs/extend.pod
==============================================================================
--- trunk/docs/extend.pod	Wed Jan 27 03:32:26 2010	(r43614)
+++ trunk/docs/extend.pod	Wed Jan 27 03:39:51 2010	(r43615)
@@ -34,16 +34,7 @@
 
 =head2 Functions
 
-=over 4
-
-=item C<Parrot_call_method(PARROT_INTERP, Parrot_PMC sub
-       Parrot_PMC object, Parrot_String method, const char *signature, ...)>
-
-Calls a method on C<object> with the given signature and arguments. C<sub> is
-the method that's being called, and C<method> is the name of the method in the
-call stack. This is useful for calling aliased methods.
-
-=back
+TODO
 
 =head1 SEE ALSO
 

Modified: trunk/docs/pdds/draft/pdd11_extending.pod
==============================================================================
--- trunk/docs/pdds/draft/pdd11_extending.pod	Wed Jan 27 03:32:26 2010	(r43614)
+++ trunk/docs/pdds/draft/pdd11_extending.pod	Wed Jan 27 03:39:51 2010	(r43615)
@@ -281,14 +281,6 @@
 up Parrot's registers in line with the Parrot calling conventions; see
 L<pdd03_calling_conventions.pod> for more details.
 
-=item C<Parrot_call_method(PARROT_INTERP, Parrot_PMC sub, Parrot_PMC obj,
-    Parrot_String method, ARGIN(const char *signature), ...)>
-
-Call the parrot subroutine C<sub> as a method on PMC object C<obj>. The method
-should have the name C<method> as a Parrot_string, and should have a function
-signature C<signature>. Any arguments to the method can be passed at the end
-as a variadic argument list.
-
 =back
 
 =head3 API - Group 2: Internals aware

Modified: trunk/include/parrot/extend.h
==============================================================================
--- trunk/include/parrot/extend.h	Wed Jan 27 03:32:26 2010	(r43614)
+++ trunk/include/parrot/extend.h	Wed Jan 27 03:39:51 2010	(r43615)
@@ -64,18 +64,6 @@
 PARROT_EXPORT
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
-void * Parrot_call_method(PARROT_INTERP,
-    Parrot_PMC sub_pmc,
-    Parrot_PMC obj,
-    Parrot_String method,
-    ARGIN(const char *signature),
-    ...)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(5);
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
 void * Parrot_call_sub(PARROT_INTERP,
     Parrot_PMC sub_pmc,
     ARGIN(const char *signature),
@@ -432,9 +420,6 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_Parrot_call_method __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(signature))
 #define ASSERT_ARGS_Parrot_call_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(signature))

Modified: trunk/src/extend.c
==============================================================================
--- trunk/src/extend.c	Wed Jan 27 03:32:26 2010	(r43614)
+++ trunk/src/extend.c	Wed Jan 27 03:39:51 2010	(r43615)
@@ -1212,74 +1212,6 @@
 
 /*
 
-=item C<void * Parrot_call_method(PARROT_INTERP, Parrot_PMC sub_pmc, Parrot_PMC
-obj, Parrot_String method, const char *signature, ...)>
-
-Call the parrot subroutine C<sub> as a method on PMC object C<obj>. The method
-should have the name C<method> as a Parrot_string, and should have a function
-signature C<signature>. Any arguments to the method can be passed at the end
-as a variadic argument list.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-Parrot_call_method(PARROT_INTERP, Parrot_PMC sub_pmc, Parrot_PMC obj,
-                        Parrot_String method, ARGIN(const char *signature), ...)
-{
-    ASSERT_ARGS(Parrot_call_method)
-    va_list args;
-    PMC  *sig_object;
-    void *result = NULL;
-    char  return_sig = signature[0];
-    char *arg_sig = (char*)malloc(strlen(signature)+2);
-    Parrot_sub *sub;
-    arg_sig[0] = 'P';
-    arg_sig[1] = 'i';
-    arg_sig[2] = 0;
-    strcat(arg_sig, signature);
-
-    va_start(args, signature);
-    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, obj, arg_sig, args);
-    va_end(args);
-    free(arg_sig);
-
-    /* Add the return argument onto the call signature object (a bit
-     * hackish, added for backward compatibility in deprecated API function,
-     * see TT #1145). */
-    switch (return_sig) {
-        case 'v':
-        {
-            Parrot_String full_sig = VTABLE_get_string(interp, sig_object);
-            Parrot_str_concat(interp, full_sig,
-                    Parrot_str_new_constant(interp, "->"), 0);
-            break;
-        }
-        case 'V':
-        case 'P':
-        {
-            Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "P"),
-                    &result);
-            break;
-        }
-        default:
-            Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
-                        "Dispatch: invalid return type %c!", return_sig);
-    }
-
-    PMC_get_sub(interp, sub_pmc, sub);
-    Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), sub->seg->const_table->constants);
-    Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
-
-    return result;
-}
-
-/*
-
 =item C<Parrot_Int Parrot_get_intreg(PARROT_INTERP, Parrot_Int regnum)>
 
 Return the value of an integer register.


More information about the parrot-commits mailing list