Author: leo
Date: Thu Feb  2 14:16:05 2006
New Revision: 11409

Modified:
   trunk/compilers/imcc/instructions.c
   trunk/compilers/imcc/pcc.c
Log:
Register allocation - don't share pcc_sub structure

* after the sub() call syntax is expanded, the pcc_sub structure
  can't hang off the sub SymReg itself, leave it at the dummy call
  label (the sub sym can be used for more then one call).
* remove another usage of pcc_sub with set_args 


Modified: trunk/compilers/imcc/instructions.c
==============================================================================
--- trunk/compilers/imcc/instructions.c (original)
+++ trunk/compilers/imcc/instructions.c Thu Feb  2 14:16:05 2006
@@ -208,13 +208,14 @@ instruction_reads(Instruction* ins, SymR
     }
     /* a sub call reads the previous args */
     if (ins->type & ITPCCSUB) {
-        assert(ins->r[0]->pcc_sub);
-        for (i = 0; i < ins->r[0]->pcc_sub->nargs; ++i) {
-            if (r == ins->r[0]->pcc_sub->args[i])
+        while (ins && ins->opnum != PARROT_OP_set_args_pc)
+            ins = ins->prev;
+        if (!ins)
+            return 0;
+        for (i = 0; i < ins->n_r; i++) {
+            if (ins->r[i] == r)
                 return 1;
         }
-
-
     }
     return 0;
 }

Modified: trunk/compilers/imcc/pcc.c
==============================================================================
--- trunk/compilers/imcc/pcc.c  (original)
+++ trunk/compilers/imcc/pcc.c  Thu Feb  2 14:16:05 2006
@@ -466,19 +466,7 @@ expand_pcc_sub_call(Parrot_Interp interp
             ins = insINS(interp, unit, ins, "invokecc" ,regs, 1);
         }
     }
-    /*
-     * move the pcc_sub structure from the dummy call label to the
-     * invoke statement
-     */
-    regs[0]->pcc_sub = sub->pcc_sub;
-    sub->pcc_sub = NULL;
     ins->type |= ITPCCSUB;
-    /*
-     * locate return label, if there is one skip it
-     */
-    if (regs[0]->pcc_sub->label && ins->next->type == ITLABEL) {
-        ins = ins->next;
-    }
 }
 
 /*

Reply via email to