[svn:parrot] r44189 - in trunk: . compilers/data_json compilers/imcc compilers/json compilers/nqp compilers/pct compilers/pge compilers/tge config/auto/sizes docs docs/book/draft docs/book/pct docs/dev docs/pdds docs/pdds/draft examples/embed examples/languages/abc examples/languages/squaak examples/pge ext/nqp-rx include/parrot lib/Parrot lib/Parrot/Configure/Step ports/cpan ports/cygwin ports/debian ports/fedora ports/mandriva ports/suse runtime/parrot/languages runtime/parrot/library runtime/parrot/library/Math src src/call src/gc src/interp src/runcore t/compilers/tge t/oo t/pmc t/src t/steps/init/hints tools/build tools/dev tools/util

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Fri Feb 19 18:44:53 UTC 2010


Author: whiteknight
Date: Fri Feb 19 18:44:49 2010
New Revision: 44189
URL: https://trac.parrot.org/parrot/changeset/44189

Log:
merge the parrot_call_dep branch to trunk. Removes mention of the old Parrot_call_* functions from the codebase, replacing most calls with Parrot_ext_call(). Most calls in the repo core have already been updated to not use these functions

Modified:
   trunk/   (props changed)
   trunk/DEPRECATED.pod
   trunk/compilers/data_json/Rules.mak   (props changed)
   trunk/compilers/imcc/Rules.mak   (props changed)
   trunk/compilers/json/Rules.mak   (props changed)
   trunk/compilers/nqp/Rules.mak   (props changed)
   trunk/compilers/pct/Rules.mak   (props changed)
   trunk/compilers/pge/Rules.mak   (props changed)
   trunk/compilers/tge/Rules.mak   (props changed)
   trunk/config/auto/sizes/intval_maxmin_c.in   (props changed)
   trunk/docs/book/draft/README   (props changed)
   trunk/docs/book/draft/appa_glossary.pod   (props changed)
   trunk/docs/book/draft/appb_patch_submission.pod   (props changed)
   trunk/docs/book/draft/appc_command_line_options.pod   (props changed)
   trunk/docs/book/draft/appd_build_options.pod   (props changed)
   trunk/docs/book/draft/appe_source_code.pod   (props changed)
   trunk/docs/book/draft/ch01_introduction.pod   (props changed)
   trunk/docs/book/draft/ch02_getting_started.pod   (props changed)
   trunk/docs/book/draft/ch07_dynpmcs.pod   (props changed)
   trunk/docs/book/draft/ch08_dynops.pod   (props changed)
   trunk/docs/book/draft/ch10_opcode_reference.pod   (props changed)
   trunk/docs/book/draft/ch11_directive_reference.pod   (props changed)
   trunk/docs/book/draft/ch12_operator_reference.pod   (props changed)
   trunk/docs/book/draft/chXX_hlls.pod   (props changed)
   trunk/docs/book/draft/chXX_library.pod   (props changed)
   trunk/docs/book/draft/chXX_testing_and_debugging.pod   (props changed)
   trunk/docs/book/pct/ch01_introduction.pod   (props changed)
   trunk/docs/book/pct/ch02_getting_started.pod   (props changed)
   trunk/docs/book/pct/ch03_compiler_tools.pod   (props changed)
   trunk/docs/book/pct/ch04_pge.pod   (props changed)
   trunk/docs/book/pct/ch05_nqp.pod   (props changed)
   trunk/docs/dev/c_functions.pod   (props changed)
   trunk/docs/embed.pod
   trunk/docs/pdds/draft/pdd11_extending.pod
   trunk/docs/pdds/pdd30_install.pod   (props changed)
   trunk/examples/embed/cotorra.c   (contents, props changed)
   trunk/examples/languages/abc/   (props changed)
   trunk/examples/languages/squaak/   (props changed)
   trunk/examples/pge/demo.pir   (props changed)
   trunk/ext/nqp-rx/Rules.mak   (props changed)
   trunk/include/parrot/call.h   (props changed)
   trunk/include/parrot/extend.h
   trunk/include/parrot/gc_api.h   (props changed)
   trunk/include/parrot/runcore_api.h   (props changed)
   trunk/include/parrot/runcore_profiling.h   (props changed)
   trunk/include/parrot/runcore_trace.h   (props changed)
   trunk/lib/Parrot/Configure/Step/Test.pm   (props changed)
   trunk/lib/Parrot/H2inc.pm   (props changed)
   trunk/ports/cpan/pause_guide.pod   (props changed)
   trunk/ports/cygwin/parrot-1.0.0-1.cygport   (props changed)
   trunk/ports/debian/libparrot-dev.install.in   (props changed)
   trunk/ports/debian/libparrot.install.in   (props changed)
   trunk/ports/debian/parrot-doc.install.in   (props changed)
   trunk/ports/debian/parrot.install.in   (props changed)
   trunk/ports/fedora/parrot.spec.fedora   (props changed)
   trunk/ports/mandriva/parrot.spec.mandriva   (props changed)
   trunk/ports/suse/parrot.spec.suse   (props changed)
   trunk/runtime/parrot/languages/   (props changed)
   trunk/runtime/parrot/library/Math/Rand.pir   (props changed)
   trunk/runtime/parrot/library/Rules.mak   (props changed)
   trunk/src/call/ops.c   (props changed)
   trunk/src/call/pcc.c   (props changed)
   trunk/src/extend.c
   trunk/src/gc/alloc_memory.c   (props changed)
   trunk/src/gc/alloc_resources.c   (props changed)
   trunk/src/gc/api.c   (props changed)
   trunk/src/gc/malloc.c   (props changed)
   trunk/src/gc/malloc_trace.c   (props changed)
   trunk/src/gc/mark_sweep.c   (props changed)
   trunk/src/gc/system.c   (props changed)
   trunk/src/interp/inter_cb.c   (props changed)
   trunk/src/interp/inter_create.c   (props changed)
   trunk/src/interp/inter_misc.c   (props changed)
   trunk/src/runcore/cores.c   (props changed)
   trunk/src/runcore/main.c   (props changed)
   trunk/src/runcore/profiling.c   (props changed)
   trunk/src/runcore/trace.c   (props changed)
   trunk/t/compilers/tge/NoneGrammar.tg   (props changed)
   trunk/t/oo/root_new.t   (props changed)
   trunk/t/pmc/namespace-old.t   (props changed)
   trunk/t/src/embed.t   (contents, props changed)
   trunk/t/src/extend.t
   trunk/t/steps/init/hints/linux-01.t   (props changed)
   trunk/tools/build/cc_flags.pl   (props changed)
   trunk/tools/build/h2inc.pl   (props changed)
   trunk/tools/dev/fetch_languages.pl   (props changed)
   trunk/tools/dev/mk_gitignore.pl   (props changed)
   trunk/tools/util/perlcritic-cage.conf   (props changed)

Modified: trunk/DEPRECATED.pod
==============================================================================
--- trunk/DEPRECATED.pod	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/DEPRECATED.pod	Fri Feb 19 18:44:49 2010	(r44189)
@@ -194,13 +194,6 @@
 
 L<https://trac.parrot.org/parrot/ticket/443>
 
-=item Sub/method invocation functions [eligible in 2.1]
-
-The old 'Parrot_call_*' functions for invoking a sub/method object from C are
-deprecated, replaced by 'Parrot_ext_call'.
-
-L<https://trac.parrot.org/parrot/ticket/1145>
-
 =item PMC Attributes Allocation Functions [experimental]
 
  Parrot_gc_allocate_pmc_attributes

Modified: trunk/docs/embed.pod
==============================================================================
--- trunk/docs/embed.pod	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/docs/embed.pod	Fri Feb 19 18:44:49 2010	(r44189)
@@ -84,21 +84,7 @@
 
 =head2 Type signatures
 
-These are used with the Parrot_call_sub family of functions.
-
-=over 4
-
-=item v - void (return only)
-
-=item I - integer (return or argument)
-
-=item N - float (return or argument)
-
-=item S - string (return or argument)
-
-=item P - PMC (return or argument)
-
-=back
+    TODO: Write about signature strings
 
 =head2 Interpreter initialization and destruction
 

Modified: trunk/docs/pdds/draft/pdd11_extending.pod
==============================================================================
--- trunk/docs/pdds/draft/pdd11_extending.pod	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/docs/pdds/draft/pdd11_extending.pod	Fri Feb 19 18:44:49 2010	(r44189)
@@ -275,11 +275,7 @@
 
 =over 4
 
-=item C<Parrot_call_sub(interp, Parrot_PMC sub, Parrot_Int argcount, ...)>
-
-Calls a Parrot subroutine, with C<argcount> PMC parameters. This function sets
-up Parrot's registers in line with the Parrot calling conventions; see
-L<pdd03_calling_conventions.pod> for more details.
+    TODO: Add new call functions here
 
 =back
 

Modified: trunk/examples/embed/cotorra.c
==============================================================================
--- trunk/examples/embed/cotorra.c	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/examples/embed/cotorra.c	Fri Feb 19 18:44:49 2010	(r44189)
@@ -203,7 +203,7 @@
         Parrot_String compiler = create_string(interp, "PIR");
         Parrot_String errstr;
         Parrot_PMC code = Parrot_compile_string(interp, compiler, exec, &errstr);
-        void *discard = Parrot_call_sub(interp, code, "v");
+        Parrot_ext_call(interp, code, "->");
         return 0;
     }
 
@@ -224,8 +224,7 @@
         Parrot_PMC parrotns = Parrot_PMC_get_pmc_strkey(interp, rootns, parrotname);
         Parrot_String name = create_string(interp, stname);
         Parrot_PMC start = Parrot_PMC_get_pmc_strkey(interp, parrotns, name);
-        void *discard;
-        discard = Parrot_call_sub(interp, start, "v");
+        Parrot_ext_call(interp, start, "->");
     }
     else {
         Parrot_runcode(interp, argc - i, argv + i);

Modified: trunk/include/parrot/extend.h
==============================================================================
--- trunk/include/parrot/extend.h	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/include/parrot/extend.h	Fri Feb 19 18:44:49 2010	(r44189)
@@ -62,24 +62,6 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
 PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void * Parrot_call_sub(PARROT_INTERP,
-    Parrot_PMC sub_pmc,
-    ARGIN(const char *signature),
-    ...)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-PARROT_EXPORT
-Parrot_Int Parrot_call_sub_ret_int(PARROT_INTERP,
-    Parrot_PMC sub_pmc,
-    ARGIN(const char *signature),
-    ...)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(3);
-
-PARROT_EXPORT
 int Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...)
         __attribute__nonnull__(2);
 
@@ -412,12 +394,6 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-#define ASSERT_ARGS_Parrot_call_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(signature))
-#define ASSERT_ARGS_Parrot_call_sub_ret_int __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(signature))
 #define ASSERT_ARGS_Parrot_eprintf __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(s))
 #define ASSERT_ARGS_Parrot_ext_call __attribute__unused__ int _ASSERT_ARGS_CHECK = (\

Modified: trunk/src/extend.c
==============================================================================
--- trunk/src/extend.c	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/src/extend.c	Fri Feb 19 18:44:49 2010	(r44189)
@@ -1058,120 +1058,6 @@
 
 /*
 
-=item C<void * Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub_pmc, const char
-*signature, ...)>
-
-Call a parrot subroutine with the given function signature. The first char in
-C<signature> denotes the return value. Next chars are arguments.
-
-The return value of this function can be void or a pointer type.
-
-Signature chars are:
-
-    v ... void return
-    I ... Parrot_Int
-    N ... Parrot_Float
-    S ... Parrot_String
-    P ... Parrot_PMC
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_WARN_UNUSED_RESULT
-PARROT_CAN_RETURN_NULL
-void *
-Parrot_call_sub(PARROT_INTERP, Parrot_PMC sub_pmc,
-                 ARGIN(const char *signature), ...)
-{
-    ASSERT_ARGS(Parrot_call_sub)
-    va_list     args;
-    PMC        *sig_object;
-    Parrot_sub *sub;
-    void       *result     = NULL;
-    const char *arg_sig    = signature;
-    char        return_sig = signature[0];
-
-    arg_sig++;
-    va_start(args, signature);
-    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL,
-        arg_sig, args);
-    va_end(args);
-
-    /* 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_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub_pmc,
-const char *signature, ...)>
-
-Like C<Parrot_call_sub>, with Parrot_Int return result.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-Parrot_Int
-Parrot_call_sub_ret_int(PARROT_INTERP, Parrot_PMC sub_pmc,
-                 ARGIN(const char *signature), ...)
-{
-    ASSERT_ARGS(Parrot_call_sub_ret_int)
-    va_list     args;
-    PMC        *sig_object;
-    Parrot_Int  result;
-    char        return_sig  = signature[0];
-    const char *arg_sig     = signature;
-    Parrot_sub *sub;
-
-    arg_sig++;
-    va_start(args, signature);
-    sig_object = Parrot_pcc_build_sig_object_from_varargs(interp, PMCNULL, arg_sig, args);
-    va_end(args);
-
-    /* Add the return argument onto the call signature object (a bit
-     * hackish, added for backward compatibility in deprecated API function,
-     * see TT #1145). */
-    Parrot_pcc_append_result(interp, sig_object, Parrot_str_new_constant(interp, "I"), &result);
-    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.

Modified: trunk/t/src/embed.t
==============================================================================
--- trunk/t/src/embed.t	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/t/src/embed.t	Fri Feb 19 18:44:49 2010	(r44189)
@@ -93,7 +93,7 @@
 "\n",
         &errstr
     );
-    Parrot_call_sub(interp, code, "v");
+    Parrot_ext_call(interp, code, "->");
 
     Parrot_destroy(interp);
     return 0;
@@ -160,7 +160,7 @@
     subname = Parrot_new_string(interp, "hello", 5, (const char *)NULL, 0);
     sub = Parrot_PMC_get_pmc_strkey(interp, parrotns,  subname);
     /* Execute it */
-    Parrot_call_sub(interp, sub, "v");
+    Parrot_ext_call(interp, sub, "->");
 
     Parrot_destroy(interp);
     return 0;
@@ -216,7 +216,7 @@
         &errstr
     );
     hellosub = Parrot_sub_new_from_c_func(interp, (void (*)())& hello, "vJ");
-    Parrot_call_sub(interp, code, "vP", hellosub);
+    Parrot_ext_call(interp, code, "P->", hellosub);
 
     Parrot_destroy(interp);
     return 0;
@@ -285,7 +285,7 @@
     Parrot_PMC_set_pmc_strkey(interp, parrotns, helloname, hellosub);
 
     /* Call it */
-    discard = Parrot_call_sub(interp, code, "v");
+    Parrot_ext_call(interp, code, "->");
 
     Parrot_destroy(interp);
     return 0;

Modified: trunk/t/src/extend.t
==============================================================================
--- trunk/t/src/extend.t	Fri Feb 19 17:49:37 2010	(r44188)
+++ trunk/t/src/extend.t	Fri Feb 19 18:44:49 2010	(r44189)
@@ -446,7 +446,7 @@
 
     Parrot_pbc_load(interp, pf);
     sub = Parrot_find_global_cur(interp, name);
-    Parrot_call_sub(interp, sub, "v");
+    Parrot_ext_call(interp, sub, "->");
     Parrot_eprintf(interp, "back\\n");
 
     /* win32 seems to buffer stderr ? */
@@ -459,7 +459,7 @@
     Parrot_PMC_set_string_native(interp, arg,
                  Parrot_str_new(interp, "hello ", 0));
 
-    Parrot_call_sub(interp, sub, "vP", arg);
+    Parrot_ext_call(interp, sub, "P->", arg);
     Parrot_eprintf(interp, "back\\n");
 
     return NULL;
@@ -657,7 +657,7 @@
         interp->current_runloop_id++;
 
         Parrot_ex_add_c_handler(interp, &jump_point);
-        Parrot_call_sub(interp, sub, "v");
+        Parrot_ext_call(interp, sub, "->");
     }
 
     Parrot_eprintf(interp, "back\\n");
@@ -781,7 +781,7 @@
     foo_name = Parrot_str_new_constant( interp, "foo" );
     sub      = Parrot_find_global_cur( interp, foo_name );
 
-    retval   = (PMC *) Parrot_call_sub( interp, sub, "V", "" );
+    Parrot_ext_call(interp, sub, "->");
 
     Parrot_exit(interp, 0);
     return 0;
@@ -812,7 +812,7 @@
     Parrot_pbc_load( interp, pf );
 
     sub      = Parrot_find_global_cur( interp, Parrot_str_new_constant( interp, "add" ) );
-    result   = Parrot_call_sub_ret_int( interp, sub, "III", 100, 200 );
+    Parrot_ext_call(interp, sub, "II->I", 100, 200, &result);
     printf( "Result is %d.\\n", result );
 
     Parrot_exit(interp, 0);


More information about the parrot-commits mailing list