]> gitweb.factorcode.org Git - factor.git/commitdiff
Better inlining for both-fixnums?
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 26 Feb 2009 20:11:26 +0000 (14:11 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 26 Feb 2009 20:11:26 +0000 (14:11 -0600)
basis/compiler/tree/cleanup/cleanup-tests.factor
basis/compiler/tree/propagation/known-words/known-words.factor

index 54f8aaf20ecae62f4666254d311a73368d6d4da0..4a2e8671fbeff2e1330dc7d7f5d3f2eb5e8d584c 100755 (executable)
@@ -510,3 +510,8 @@ cell-bits 32 = [
     [ { array } declare 2 <groups> [ . . ] assoc-each ]
     \ nth-unsafe inlined?
 ] unit-test
+
+[ t ] [
+    [ { fixnum fixnum } declare = ]
+    \ both-fixnums? inlined?
+] unit-test
\ No newline at end of file
index d5aa5318a4a47503048f0ee7cabcfaffad4626ac..ecfd415579cee80deb784703965793f2bc7747e0 100644 (file)
@@ -199,8 +199,11 @@ generic-comparison-ops [
 ] "outputs" set-word-prop
 
 \ both-fixnums? [
-    [ class>> fixnum classes-intersect? not ] either?
-    f <literal-info> object-info ?
+    [ class>> ] bi@ {
+        { [ 2dup [ fixnum classes-intersect? not ] either? ] [ f <literal-info> ] }
+        { [ 2dup [ fixnum class<= ] both? ] [ t <literal-info> ] }
+        [ object-info ]
+    } cond 2nip
 ] "outputs" set-word-prop
 
 {