From bda8b2dda63687176c35602c86a10accb3f3b100 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 26 Feb 2009 14:11:26 -0600 Subject: [PATCH] Better inlining for both-fixnums? --- basis/compiler/tree/cleanup/cleanup-tests.factor | 5 +++++ .../tree/propagation/known-words/known-words.factor | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/basis/compiler/tree/cleanup/cleanup-tests.factor b/basis/compiler/tree/cleanup/cleanup-tests.factor index 54f8aaf20e..4a2e8671fb 100755 --- a/basis/compiler/tree/cleanup/cleanup-tests.factor +++ b/basis/compiler/tree/cleanup/cleanup-tests.factor @@ -510,3 +510,8 @@ cell-bits 32 = [ [ { array } declare 2 [ . . ] assoc-each ] \ nth-unsafe inlined? ] unit-test + +[ t ] [ + [ { fixnum fixnum } declare = ] + \ both-fixnums? inlined? +] unit-test \ No newline at end of file diff --git a/basis/compiler/tree/propagation/known-words/known-words.factor b/basis/compiler/tree/propagation/known-words/known-words.factor index d5aa5318a4..ecfd415579 100644 --- a/basis/compiler/tree/propagation/known-words/known-words.factor +++ b/basis/compiler/tree/propagation/known-words/known-words.factor @@ -199,8 +199,11 @@ generic-comparison-ops [ ] "outputs" set-word-prop \ both-fixnums? [ - [ class>> fixnum classes-intersect? not ] either? - f object-info ? + [ class>> ] bi@ { + { [ 2dup [ fixnum classes-intersect? not ] either? ] [ f ] } + { [ 2dup [ fixnum class<= ] both? ] [ t ] } + [ object-info ] + } cond 2nip ] "outputs" set-word-prop {