[svn:parrot] r40460 - branches/pcc_arg_unify/src/pmc

allison at svn.parrot.org allison at svn.parrot.org
Sun Aug 9 02:07:32 UTC 2009


Author: allison
Date: Sun Aug  9 02:07:32 2009
New Revision: 40460
URL: https://trac.parrot.org/parrot/changeset/40460

Log:
[pcc] Update method calls in Class and Object PMCs to use new C call
interface.

Modified:
   branches/pcc_arg_unify/src/pmc/class.pmc
   branches/pcc_arg_unify/src/pmc/object.pmc

Modified: branches/pcc_arg_unify/src/pmc/class.pmc
==============================================================================
--- branches/pcc_arg_unify/src/pmc/class.pmc	Sun Aug  9 01:57:48 2009	(r40459)
+++ branches/pcc_arg_unify/src/pmc/class.pmc	Sun Aug  9 02:07:32 2009	(r40460)
@@ -367,7 +367,8 @@
         meth = Parrot_oo_find_vtable_override_for_class(interp, parent, name);
 
         if (!PMC_IS_NULL(meth))
-            Parrot_run_meth_fromc_args(interp, meth, object, name, "vP", init);
+            Parrot_pcc_invoke_sub_from_c_args(interp, meth,
+                    "PiP->", object, init);
     }
 }
 

Modified: branches/pcc_arg_unify/src/pmc/object.pmc
==============================================================================
--- branches/pcc_arg_unify/src/pmc/object.pmc	Sun Aug  9 01:57:48 2009	(r40459)
+++ branches/pcc_arg_unify/src/pmc/object.pmc	Sun Aug  9 02:07:32 2009	(r40460)
@@ -173,8 +173,12 @@
         /* If there's a vtable override for 'name' run that instead. */
         PMC * const method = Parrot_oo_find_vtable_override(interp, _class, name);
 
-        if (!PMC_IS_NULL(method))
-            return (STRING *)Parrot_run_meth_fromc_args(interp, method, SELF, name, "S");
+        if (!PMC_IS_NULL(method)) {
+            STRING *result;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->S",
+                    SELF, &result);
+            return result;
+        }
         else
             return VTABLE_get_string(interp, _class);
     }
@@ -218,9 +222,12 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 VTABLE_get_class(interp, SELF), get_attr);
 
-        if (!PMC_IS_NULL(method))
-            return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                    get_attr, "PS", name);
+        if (!PMC_IS_NULL(method)) {
+            PMC *result;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiS->P",
+                    SELF, name, &result);
+            return result;
+        }
 
         /* Look up the index. */
         index = get_attrib_index(interp, obj->_class, name);
@@ -277,9 +284,8 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 VTABLE_get_class(interp, SELF), vtable_meth_name);
         if (!PMC_IS_NULL(method)) {
-            PMC *unused = (PMC *)Parrot_run_meth_fromc_args(interp, method,
-                SELF, vtable_meth_name, "vSP", name, value);
-            UNUSED(unused);
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiSP->",
+                SELF, name, value);
             return;
         }
 
@@ -349,9 +355,12 @@
             method = Parrot_oo_find_vtable_override_for_class(interp, cur_class,
                     find_method);
 
-            if (!PMC_IS_NULL(method))
-                return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                        find_method, "PS", name);
+            if (!PMC_IS_NULL(method)) {
+                PMC *result;
+                Parrot_pcc_invoke_sub_from_c_args(interp, method,
+                        "PiS->P", SELF, name, &result);
+                return result;
+            }
 
             /* If it's from this universe or the class doesn't inherit from
              * anything outside of it... */
@@ -395,9 +404,8 @@
                     cur_class, meth_name);
             if (!PMC_IS_NULL(meth)) {
                 INTVAL result;
-                Parrot_pcc_invoke_sub_from_c_args(interp, meth, "P->I", pmc, &result);
+                Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi->I", pmc, &result);
                 return result;
-/*            return (INTVAL)Parrot_run_meth_fromc_args_reti(interp, meth, pmc, meth_name, "I"); */
 
             }
             /* method name is get_integer */
@@ -431,9 +439,12 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 classobj, get_class);
 
-        if (!PMC_IS_NULL(method))
-            return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                    get_class, "P");
+        if (!PMC_IS_NULL(method)) {
+            PMC *result;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->P",
+                    SELF, &result);
+            return result;
+        }
 
         return classobj;
     }
@@ -455,9 +466,12 @@
         PMC * const method = Parrot_oo_find_vtable_override(interp,
                 classobj, get_namespace);
 
-        if (!PMC_IS_NULL(method))
-            return (PMC *)Parrot_run_meth_fromc_args(interp, method, SELF,
-                    get_namespace, "P");
+        if (!PMC_IS_NULL(method)) {
+            PMC *result;
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "Pi->P",
+                    SELF, &result);
+            return result;
+        }
         else
             return VTABLE_inspect_str(interp, classobj, CONST_STRING(interp, "namespace"));
 
@@ -541,9 +555,13 @@
             PMC * const method = Parrot_oo_find_vtable_override(interp,
                 classobj, meth_name);
 
-            if (!PMC_IS_NULL(method)
-             && Parrot_run_meth_fromc_args_reti(interp, method, SELF, meth_name, "IS", role_name))
-                return 1;
+            if (!PMC_IS_NULL(method)) {
+                INTVAL result;
+                Parrot_pcc_invoke_sub_from_c_args(interp, method,
+                        "PiS->I", SELF, role_name, &result);
+                if (result)
+                    return 1;
+            }
         }
         /* Check the superclass's vtable interface, if any. */
         if (SUPER(role_name))
@@ -658,8 +676,12 @@
             /* Look for a method and run it if we find one. */
             PMC * const meth =
                 Parrot_oo_find_vtable_override_for_class(interp, cur_class, meth_name);
-            if (!PMC_IS_NULL(meth))
-                return (PMC*)Parrot_run_meth_fromc_args(interp, meth, pmc, meth_name, "P");
+            if (!PMC_IS_NULL(meth)) {
+                PMC *result;
+                Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi->P",
+                        pmc, &result);
+                return result;
+            }
         }
 
         /* If we get here, no custom clone. Create a new object PMC. */
@@ -811,7 +833,8 @@
                 classobj, meth_name);
 
         if (!PMC_IS_NULL(method))
-            Parrot_run_meth_fromc_args(interp, method, SELF, meth_name, "vP", type);
+            Parrot_pcc_invoke_sub_from_c_args(interp, method, "PiP->",
+                    SELF, type);
         else
             SUPER(type);
     }


More information about the parrot-commits mailing list