]> gitweb.factorcode.org Git - factor.git/commitdiff
Bootstrap and compiler fixes
authorslava <slava@factorcode.org>
Tue, 9 May 2006 16:38:57 +0000 (16:38 +0000)
committerslava <slava@factorcode.org>
Tue, 9 May 2006 16:38:57 +0000 (16:38 +0000)
library/bootstrap/boot-stage1.factor
library/compiler/generator/architecture.factor
library/compiler/generator/templates.factor
library/compiler/optimizer/inline-methods.factor
library/test/test.factor

index 041bc8be1e50086b9723f3b26ac319c86681a06a..348d5c208cd675095505a02535fc30a5cd727ebb 100644 (file)
@@ -9,9 +9,17 @@ vectors words ;
 
 "/library/bootstrap/primitives.factor" run-resource
 
+: parse-resource* ( path -- )
+    [ parse-resource ] catch [
+        dup error.
+        "Try again? [yn]" print
+        readln "yY" subseq?
+        [ drop parse-resource* ] [ rethrow ] if
+    ] when* ;
+
 : if-arch ( arch seq -- )
     architecture get rot member?
-    [ [ parse-resource % ] each ] [ drop ] if ;
+    [ [ parse-resource* % ] each ] [ drop ] if ;
 
 ! The [ ] make form creates a boot quotation
 [
@@ -279,7 +287,7 @@ vectors words ;
         "/doc/handbook/tools.facts"
         "/doc/handbook/tutorial.facts"
         "/doc/handbook/words.facts"
-    } [ parse-resource % ] each
+    } [ parse-resource* % ] each
     
     { "x86" "pentium4" } {
         "/library/compiler/x86/assembler.factor"
@@ -330,3 +338,4 @@ vocabularies get [
 all-words [ generic? ] subset [ make-generic ] each
 
 FORGET: if-arch
+FORGET: parse-resource*
index 98d2e84a622142dacf537887c919e3e0aa442e33..f93b5e80c33e26a5185f538592ac47d2bb1c11e8 100644 (file)
@@ -78,8 +78,8 @@ DEFER: %move-int>float ( dst src -- )
         2drop
     ] [
         2dup [ delegate class ] 2apply 2array {
-            { [ { int-regs int-regs } = ] [ %move-int>int ] }
-            { [ { float-regs int-regs } = ] [ %move-int>float ] }
+            { [ dup { int-regs int-regs } = ] [ drop %move-int>int ] }
+            { [ dup { float-regs int-regs } = ] [ drop %move-int>float ] }
         } cond
     ] if ;
 
@@ -92,8 +92,14 @@ DEFER: %box ( n reg-class func -- )
 
 DEFER: %box-struct ( n reg-class size -- )
 
+DEFER: %stack>freg ( n reg reg-class -- )
+
+DEFER: %freg>stack ( n reg reg-class -- )
+
 DEFER: %alien-invoke ( library function -- )
 
+DEFER: %cleanup ( n -- )
+
 DEFER: %alien-callback ( quot -- )
 
 DEFER: %callback-value ( reg-class func -- )
index ca61addff84dbeae11690da18c65eb28b496626c..bf19329b88b2d5112adc152172252cdd7a62e548 100644 (file)
@@ -179,8 +179,8 @@ SYMBOL: phantom-r
     dup integer? [ <int-vreg> ] [ reg-spec>class alloc-reg ] if ;
 
 : (lazy-load) ( value spec -- value )
-    spec>vreg swap [
-        {
+    spec>vreg [
+        swap {
             { [ dup loc? ] [ %peek ] }
             { [ dup vreg? ] [ %move ] }
             { [ t ] [ 2drop ] }
index 7e1383047cda71c020b4614a5fca318313df034d..4873389ded19ad3e56c46b56ee72db9d2b485b84 100644 (file)
@@ -27,7 +27,7 @@ kernel-internals lists math namespaces sequences words ;
     ] [
         over node-in-d dataflow-with
         [ >r node-param r> remember-node ] 2keep
-        [ subst-node ] keep [ infer-classes ] keep
+        [ subst-node ] keep
     ] if ;
 
 ! Single dispatch method inlining optimization
index 3271dacc61418a7a6acddddc13101ec38bfeab43..6f538b2a2ddbb38292163245c8a94c15f7995cf1 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2003, 2006 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 IN: test
-USING: arrays errors hashtables inspector io kernel math
-memory namespaces parser prettyprint sequences strings words ;
+USING: arrays errors hashtables inspector io kernel lists math
+memory namespaces parser prettyprint sequences strings words
+vectors ;
 
 TUPLE: assert got expect ;
 
@@ -36,7 +37,7 @@ M: assert summary drop "Assertion failed" ;
 
 SYMBOL: failures
 
-: failure failures get push ;
+: failure failures [ ?push ] change ;
 
 : test-handler ( name quot -- ? )
     catch [ dup error. 2array failure f ] [ t ] if* ;
@@ -53,7 +54,7 @@ SYMBOL: failures
     ] test-handler ;
 
 : prepare-tests ( -- )
-    V{ } clone failures set "temporary" forget-vocab ;
+    failures off "temporary" forget-vocab ;
 
 : passed.
     "Tests passed:" print . ;