[svn:parrot] r44638 - branches/pcc_hackathon_6Mar10/compilers/imcc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Fri Mar 5 07:05:55 UTC 2010


Author: chromatic
Date: Fri Mar  5 07:05:48 2010
New Revision: 44638
URL: https://trac.parrot.org/parrot/changeset/44638

Log:
[IMCC] Changed IMCC's PCC generator to emit get_results *after* the
corresponding invoke.  Cats and dogs now live together.  Call your parents.

Modified:
   branches/pcc_hackathon_6Mar10/compilers/imcc/pcc.c

Modified: branches/pcc_hackathon_6Mar10/compilers/imcc/pcc.c
==============================================================================
--- branches/pcc_hackathon_6Mar10/compilers/imcc/pcc.c	Fri Mar  5 05:16:10 2010	(r44637)
+++ branches/pcc_hackathon_6Mar10/compilers/imcc/pcc.c	Fri Mar  5 07:05:48 2010	(r44638)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2009, Parrot Foundation.
+ * Copyright (C) 2003-2010, Parrot Foundation.
  * $Id$
  */
 
@@ -416,7 +416,8 @@
     SymReg      *regs[2];
 
     /* if this sub is a method, unshift 'self' as first param */
-    if ((unit->type & IMC_HAS_SELF) || (sub->pcc_sub->pragma & (P_METHOD | P_VTABLE))) {
+    if ((unit->type & IMC_HAS_SELF)
+    ||  (sub->pcc_sub->pragma & (P_METHOD | P_VTABLE))) {
         SymReg *self = get_sym(interp, "self");
         if (!self) {
             self       = mk_symreg(interp, "self", 'P');
@@ -866,11 +867,6 @@
         return;
     }
 
-    /* handle return results */
-    n   = sub->pcc_sub->nret;
-    ins = pcc_get_args(interp, unit, ins, "get_results", n,
-            sub->pcc_sub->ret, sub->pcc_sub->ret_flags);
-
     /* insert the call */
     if (meth_call) {
         regs[0] = sub->pcc_sub->object;
@@ -899,6 +895,11 @@
     }
 
     ins->type |= ITPCCSUB;
+
+    /* handle return results */
+    n   = sub->pcc_sub->nret;
+    ins = pcc_get_args(interp, unit, ins, "get_results", n,
+            sub->pcc_sub->ret, sub->pcc_sub->ret_flags);
 }
 
 /*


More information about the parrot-commits mailing list