From b6f6e880bf08188b07ef752a99fee6ae84e6c1a7 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Mar 2009 13:57:13 -0500 Subject: [PATCH 1/3] Make partially dispatched integer ops foldable --- basis/compiler/tree/cleanup/cleanup-tests.factor | 5 +++++ basis/math/partial-dispatch/partial-dispatch.factor | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index 4a2e8671fb..e451694f48 100755 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -514,4 +514,9 @@ cell-bits 32 = [ [ t ] [ [ { fixnum fixnum } declare = ] \ both-fixnums? inlined? +] unit-test + +[ t ] [ + [ { integer integer } declare + drop ] + { + +-integer-integer } inlined? ] unit-test \ No newline at end of file diff --git a/basis/math/partial-dispatch/partial-dispatch.factor b/basis/math/partial-dispatch/partial-dispatch.factor index 6618578a99..08cd8fb470 100644 --- a/basis/math/partial-dispatch/partial-dispatch.factor +++ b/basis/math/partial-dispatch/partial-dispatch.factor @@ -84,7 +84,7 @@ M: word integer-op-input-classes : define-integer-op-word ( fix-word big-word triple -- ) [ - [ 2nip integer-op-word ] [ integer-op-quot ] 3bi + [ 2nip integer-op-word dup make-foldable ] [ integer-op-quot ] 3bi (( x y -- z )) define-declared ] [ 2nip From fdcd8f210addacf233c705c4726de4cf7caea901 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Mar 2009 13:57:31 -0500 Subject: [PATCH 2/3] Add 'see' to default vocab search path --- core/parser/parser.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/core/parser/parser.factor b/core/parser/parser.factor index ac1c2695f2..c68d453b15 100644 --- a/core/parser/parser.factor +++ b/core/parser/parser.factor @@ -176,6 +176,7 @@ SYMBOL: interactive-vocabs "memory" "namespaces" "prettyprint" + "see" "sequences" "slicing" "sorting" From 40dae755b14acb2c32e7f4fd32fd09c4d94ac45e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 11 Mar 2009 14:02:29 -0500 Subject: [PATCH 3/3] Change execute( to execute-unsafe( since in this case we know the types --- basis/regexp/regexp.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/regexp/regexp.factor b/basis/regexp/regexp.factor index d116bff73d..791b0b838b 100644 --- a/basis/regexp/regexp.factor +++ b/basis/regexp/regexp.factor @@ -40,7 +40,7 @@ M: lookbehind question>quot ! Returns ( index string -- ? ) : match-index-from ( i string regexp -- index/f ) ! This word is unsafe. It assumes that i is a fixnum ! and that string is a string. - dup dfa>> execute( index string regexp -- i/f ) ; + dup dfa>> execute-unsafe( index string regexp -- i/f ) ; GENERIC: end/start ( string regexp -- end start ) M: regexp end/start drop length 0 ; @@ -72,7 +72,7 @@ PRIVATE> [ dup [ reverse? [ from>> ] [ to>> ] if ] when ] keep ; inline : do-next-match ( i string regexp -- i match/f ) - dup next-match>> execute( i string regexp -- i match/f ) ; inline + dup next-match>> execute-unsafe( i string regexp -- i match/f ) ; inline PRIVATE>