# New Ticket Created by  "Sean O'Rourke" 
# Please include the string:  [perl #813]
# in the subject line of all future correspondence about this issue. 
# <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=813 >


- updates IMCC to use keyed ops for spilling

- fixes a spelling error (n_spill vs. n_spilled)

- removes parameter from simplify(), having it use the global
interference_graph instead.  NOTE: this is the same as the change in
ticket 770.

/s


-- attachment  1 ------------------------------------------------------
url: http://bugs6.perl.org/rt2/attach/3816/3537/e5c315/imcc.patch

? imcc
? imcparser.c
? imcparser.h
? imclexer.c
? blah
? a.pbc
? foo.imc
? a.pasm
? bar.imc
? imcparser.output
? foo.p6
? imcc2.patch
? imcc.patch
Index: imc.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/imc.c,v
retrieving revision 1.9
diff -u -r1.9 imc.c
--- imc.c       4 Jul 2002 02:58:30 -0000       1.9
+++ imc.c       14 Jul 2002 15:59:04 -0000
@@ -180,9 +180,11 @@
  *
  */
 
-int simplify (SymReg **g){
+int simplify (){
     int changes = 0;
     int x;
+
+    SymReg ** g = interference_graph;
     
     for(x = 0; x < n_symbols; x++) {
        if (g[x]->simplified) {
@@ -406,7 +408,7 @@
 
        if (needs_fetch && !after_spilled) {
 
-           sprintf(buf, "set %s, P31, %d #FETCH", "%s", n_spilled); /*ouch*/
+           sprintf(buf, "set %s, P31[%d] #FETCH", "%s", n_spilled); /*ouch*/
 
            new_instructions[j++] = mk_instruction(
                        buf, new_symbol, NULL, NULL, NULL, IF_r1_write);
@@ -415,7 +417,7 @@
 
        if (!needs_spilling && after_needs_store) {
 
-           sprintf(buf, "set P31, %d, %s #STORE", n_spilled, "%s"); /*ouch, ouch*/
+           sprintf(buf, "set P31[%d], %s #STORE", n_spilled, "%s"); /*ouch, ouch*/
            
            new_instructions[j++] = mk_instruction(
                        buf, new_symbol, NULL, NULL, NULL, IF_r1_write);
Index: imc.h
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/imc.h,v
retrieving revision 1.8
diff -u -r1.8 imc.h
--- imc.h       4 Jul 2002 02:58:30 -0000       1.8
+++ imc.h       14 Jul 2002 15:59:04 -0000
@@ -36,7 +36,7 @@
 char *str_cat(const char *, const char *);
 
 int IMCC_DEBUG;
-int n_spill;
+int n_spilled;
 SymReg** interference_graph;
 
 
Index: instructions.c
===================================================================
RCS file: /cvs/public/parrot/languages/imcc/instructions.c,v
retrieving revision 1.1
diff -u -r1.1 instructions.c
--- instructions.c      4 Jul 2002 02:58:30 -0000       1.1
+++ instructions.c      14 Jul 2002 15:59:04 -0000
@@ -82,7 +82,7 @@
 
 void emit_flush() {
     int i;
-    if (n_spill > 0) {
+    if (n_spilled > 0) {
        printf("new P31, .PerlArray\n");
     }
     

Reply via email to