diff --git a/library/alien/c-types.factor b/library/alien/c-types.factor index 90b0ddf0f3..4e67313de4 100644 --- a/library/alien/c-types.factor +++ b/library/alien/c-types.factor @@ -27,6 +27,7 @@ SYMBOL: c-types : define-c-type ( quot name -- ) >r [ swap bind ] keep r> c-types get set-hash ; + inline : ( size -- c-ptr ) cell / ceiling ; diff --git a/library/bootstrap/image.factor b/library/bootstrap/image.factor index e035c8e371..a01bd70bf8 100644 --- a/library/bootstrap/image.factor +++ b/library/bootstrap/image.factor @@ -160,7 +160,7 @@ M: f ' ( obj -- ptr ) : word-error ( word msg -- ) [ % dup word-vocabulary % " " % word-name % ] "" make - throw ; + throw ; inline : transfer-word ( word -- word ) #! This is a hack. See doc/bootstrap.txt. diff --git a/library/compiler/generator.factor b/library/compiler/generator.factor index 2ad15605a9..f4a1ebb035 100644 --- a/library/compiler/generator.factor +++ b/library/compiler/generator.factor @@ -2,7 +2,7 @@ ! See http://factor.sf.net/license.txt for BSD license. IN: compiler-backend USING: assembler compiler errors inference kernel lists math -namespaces sequences strings vectors words ; +memory namespaces sequences strings vectors words ; ! Compile a VOP. GENERIC: generate-node ( vop -- ) @@ -59,6 +59,10 @@ M: %target generate-node GENERIC: v>operand +M: integer v>operand tag-bits shift ; + +M: f v>operand address ; + : dest/src ( vop -- dest src ) dup vop-out-1 v>operand swap vop-in-1 v>operand ; diff --git a/library/compiler/ppc/generator.factor b/library/compiler/ppc/generator.factor index d295095b68..04ad255895 100644 --- a/library/compiler/ppc/generator.factor +++ b/library/compiler/ppc/generator.factor @@ -12,7 +12,6 @@ kernel-internals lists math memory namespaces words ; : compile-c-call ( symbol dll -- ) 2dup dlsym 19 LOAD32 0 1 rel-dlsym 19 MTLR BLRL ; -M: integer v>operand tag-bits shift ; M: vreg v>operand vreg-n 17 + ; M: %prologue generate-node ( vop -- ) diff --git a/library/compiler/x86/generator.factor b/library/compiler/x86/generator.factor index b00f88b530..aa3f55dee6 100644 --- a/library/compiler/x86/generator.factor +++ b/library/compiler/x86/generator.factor @@ -4,7 +4,6 @@ IN: compiler-backend USING: alien assembler compiler inference kernel kernel-internals lists math memory namespaces sequences words ; -M: integer v>operand tag-bits shift ; M: vreg v>operand vreg-n { EAX ECX EDX } nth ; ! Not used on x86 diff --git a/library/test/compiler/intrinsics.factor b/library/test/compiler/intrinsics.factor index 6896328cd6..b0e74681d1 100644 --- a/library/test/compiler/intrinsics.factor +++ b/library/test/compiler/intrinsics.factor @@ -163,3 +163,5 @@ math-internals test words ; [ t ] [ 1 20 shift neg 1 20 shift neg [ fixnum* ] compile-1 1 40 shift = ] unit-test [ 268435456 ] [ -268435456 >fixnum -1 [ fixnum/i ] compile-1 ] unit-test + +[ t ] [ f [ f eq? ] compile-1 ] unit-test diff --git a/library/unix/io.factor b/library/unix/io.factor index 1739f68426..f02fe715e1 100644 --- a/library/unix/io.factor +++ b/library/unix/io.factor @@ -83,7 +83,7 @@ M: port set-timeout ( timeout port -- ) : defer-error ( port -- ? ) #! Return t if it is an unrecoverable error. err_no dup EAGAIN = over EINTR = or - [ 2drop f ] [ strerror swap report-error ] ifte ; + [ 2drop f ] [ strerror swap report-error t ] ifte ; ! Associates a port with a list of continuations waiting on the ! port to finish I/O