"/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
[
"/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"
all-words [ generic? ] subset [ make-generic ] each
FORGET: if-arch
+FORGET: parse-resource*
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 ;
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 -- )
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 ] }
] [
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
! 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 ;
SYMBOL: failures
-: failure failures get push ;
+: failure failures [ ?push ] change ;
: test-handler ( name quot -- ? )
catch [ dup error. 2array failure f ] [ t ] if* ;
] test-handler ;
: prepare-tests ( -- )
- V{ } clone failures set "temporary" forget-vocab ;
+ failures off "temporary" forget-vocab ;
: passed.
"Tests passed:" print . ;