]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.linear-scan: fix bad interaction between inactive intervals and sync...
authorSlava Pestov <slava@factorcode.org>
Fri, 30 Jul 2010 01:06:48 +0000 (21:06 -0400)
committerSlava Pestov <slava@factorcode.org>
Fri, 30 Jul 2010 01:06:48 +0000 (21:06 -0400)
basis/compiler/cfg/linear-scan/allocation/allocation.factor
basis/compiler/cfg/linear-scan/assignment/assignment.factor

index f102a6ae9ca1adc4c892858935e4495543f952e0..89c03b34f3860d8b052b1fd14746f7712117f6aa 100644 (file)
@@ -62,8 +62,8 @@ M: live-interval handle
 
 M: sync-point handle ( sync-point -- )
     [ n>> deactivate-intervals ]
-    [ handle-sync-point ]
     [ n>> activate-intervals ]
+    [ handle-sync-point ]
     tri ;
 
 : smallest-heap ( heap1 heap2 -- heap )
index ef02b890f7b17991a27d39d27e88943255fe2d3b..365d4e2f21382a1715edb7392fb3efeb571fbb6a 100644 (file)
@@ -39,6 +39,11 @@ SYMBOL: pending-interval-assoc
         drop leader vreg rep-of lookup-spill-slot
     ] unless ;
 
+ERROR: not-spilled-error vreg ;
+
+: vreg>spill-slot ( vreg -- spill-slot )
+    dup vreg>reg dup spill-slot? [ nip ] [ drop leader not-spilled-error ] if ;
+
 : vregs>regs ( vregs -- assoc )
     [ f ] [ [ dup vreg>reg ] H{ } map>assoc ] if-empty ;
 
@@ -144,7 +149,7 @@ M: vreg-insn assign-registers-in-insn
 
 M: gc-map-insn assign-registers-in-insn
     [ [ assign-insn-defs ] [ assign-insn-uses ] [ assign-insn-temps ] tri ]
-    [ gc-map>> [ [ vreg>reg ] map ] change-gc-roots drop ]
+    [ gc-map>> [ [ vreg>spill-slot ] map ] change-gc-roots drop ]
     bi ;
 
 M: insn assign-registers-in-insn drop ;