]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix the build
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 9 Sep 2009 18:44:54 +0000 (13:44 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Wed, 9 Sep 2009 18:44:54 +0000 (13:44 -0500)
basis/compiler/cfg/checker/checker.factor
basis/compiler/cfg/mr/mr.factor
basis/compiler/cfg/optimizer/optimizer.factor
basis/compiler/cfg/save-contexts/save-contexts-tests.factor
basis/compiler/cfg/utilities/utilities.factor
basis/cpu/x86/features/tags.txt [new file with mode: 0644]

index ef8aa56cd2fb3d9afbb20634cad546aceae4ee11..510d7c45cbf5f036321859632347139acef53b7e 100644 (file)
@@ -1,18 +1,22 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel compiler.cfg.instructions compiler.cfg.rpo
-compiler.cfg.def-use compiler.cfg.linearization compiler.cfg.utilities
-compiler.cfg.mr combinators.short-circuit accessors math
-sequences sets assocs ;
+USING: kernel combinators.short-circuit accessors math sequences
+sets assocs compiler.cfg.instructions compiler.cfg.rpo
+compiler.cfg.def-use compiler.cfg.linearization
+compiler.cfg.utilities compiler.cfg.mr compiler.utilities ;
 IN: compiler.cfg.checker
 
+! Check invariants
+
 ERROR: bad-kill-block bb ;
 
 : check-kill-block ( bb -- )
-    dup instructions>> first2
-    swap ##epilogue? [
-        { [ ##return? ] [ ##callback-return? ] [ ##jump? ] } 1||
-    ] [ ##branch? ] if
+    dup instructions>> dup penultimate ##epilogue? [
+        {
+            [ length 2 = ]
+            [ last { [ ##return? ] [ ##callback-return? ] [ ##jump? ] } 1|| ]
+        } 1&&
+    ] [ last ##branch? ] if
     [ drop ] [ bad-kill-block ] if ;
 
 ERROR: last-insn-not-a-jump bb ;
index de679cbcc2e2ec0c0e9dc7f5168c86e12eb705a7..a46e6c15cb6e5d62a9a803dfdf147083a001ed65 100644 (file)
@@ -2,11 +2,13 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel namespaces accessors compiler.cfg
 compiler.cfg.linearization compiler.cfg.gc-checks
-compiler.cfg.linear-scan compiler.cfg.build-stack-frame ;
+compiler.cfg.save-contexts compiler.cfg.linear-scan
+compiler.cfg.build-stack-frame ;
 IN: compiler.cfg.mr
 
 : build-mr ( cfg -- mr )
     insert-gc-checks
+    insert-save-contexts
     linear-scan
     flatten-cfg
     build-stack-frame ;
\ No newline at end of file
index 35e0c6e3aa9541830258c981cf47d978d82a31d7..649032b46936d958d214ea39a85fdfb5ed78d365 100644 (file)
@@ -13,7 +13,6 @@ compiler.cfg.dce
 compiler.cfg.write-barrier
 compiler.cfg.representations
 compiler.cfg.two-operand
-compiler.cfg.save-contexts
 compiler.cfg.ssa.destruction
 compiler.cfg.empty-blocks
 compiler.cfg.checker ;
@@ -39,7 +38,6 @@ SYMBOL: check-optimizer?
     eliminate-write-barriers
     select-representations
     convert-two-operand
-    insert-save-contexts
     destruct-ssa
     delete-empty-blocks
     ?check ;
index 85c71ddbc8982f1638cbb87cb7f13baf2dbce6e9..23646cfcd7bd274336ba1ec5e1a4c9f38830e876 100644 (file)
@@ -1,19 +1,22 @@
 USING: accessors compiler.cfg.debugger
-compiler.cfg.instructions compiler.cfg.save-contexts namespaces
-tools.test ;
+compiler.cfg.instructions compiler.cfg.registers
+compiler.cfg.save-contexts kernel namespaces tools.test ;
 IN: compiler.cfg.save-contexts.tests
 
+0 vreg-counter set-global
+H{ } clone representations set
+
 V{
-    T{ ##save-context f 0 1 f }
-    T{ ##save-context f 0 1 t }
+    T{ ##unary-float-function f 2 3 "sqrt" }
     T{ ##branch }
 } 0 test-bb
 
-0 get combine-in-block
+0 get insert-save-context
 
 [
     V{
-        T{ ##save-context f 0 1 t }
+        T{ ##save-context f 1 2 f }
+        T{ ##unary-float-function f 2 3 "sqrt" }
         T{ ##branch }
     }
 ] [
@@ -25,7 +28,7 @@ V{
     T{ ##branch }
 } 0 test-bb
 
-0 get combine-in-block
+0 get insert-save-context
 
 [
     V{
index bb61a6393905a2c5c4c5c701ae66151445a0dab9..19c73eebd470397c2ec4a5de1069216edb59e691 100644 (file)
@@ -2,14 +2,14 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators combinators.short-circuit
 cpu.architecture kernel layouts locals make math namespaces sequences
-sets vectors fry compiler.cfg compiler.cfg.instructions
-compiler.cfg.rpo arrays ;
+sets vectors fry arrays compiler.cfg compiler.cfg.instructions
+compiler.cfg.rpo compiler.utilities ;
 IN: compiler.cfg.utilities
 
 PREDICATE: kill-block < basic-block
     instructions>> {
-        [ length 2 = ]
-        [ first kill-vreg-insn? ]
+        [ length 2 >= ]
+        [ penultimate kill-vreg-insn? ]
     } 1&& ;
 
 : back-edge? ( from to -- ? )
diff --git a/basis/cpu/x86/features/tags.txt b/basis/cpu/x86/features/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable