compiler.tree.propagation: fix both-fixnums? trick
parent
7f6ae34d72
commit
0fbf454b18
|
@ -220,16 +220,6 @@ generic-comparison-ops [
|
||||||
2bi and maybe-or-never
|
2bi and maybe-or-never
|
||||||
] "outputs" set-word-prop
|
] "outputs" set-word-prop
|
||||||
|
|
||||||
\ both-fixnums? [
|
|
||||||
node-input-infos first2 [ class>> ] bi@ {
|
|
||||||
{ [ 2dup [ fixnum classes-intersect? not ] either? ] [ [ 2drop f ] ] }
|
|
||||||
{ [ 2dup [ fixnum class<= ] both? ] [ [ 2drop t ] ] }
|
|
||||||
{ [ dup fixnum class<= ] [ [ drop fixnum? ] ] }
|
|
||||||
{ [ over fixnum class<= ] [ [ nip fixnum? ] ] }
|
|
||||||
[ f ]
|
|
||||||
} cond 2nip
|
|
||||||
] "custom-inlining" set-word-prop
|
|
||||||
|
|
||||||
{
|
{
|
||||||
{ >fixnum fixnum }
|
{ >fixnum fixnum }
|
||||||
{ bignum>fixnum fixnum }
|
{ bignum>fixnum fixnum }
|
||||||
|
|
|
@ -313,3 +313,14 @@ M\ set intersect [ intersect-quot ] 1 define-partial-eval
|
||||||
[ depends-on-definition ] [ heap-size '[ _ ] ] bi
|
[ depends-on-definition ] [ heap-size '[ _ ] ] bi
|
||||||
] [ drop f ] if
|
] [ drop f ] if
|
||||||
] 1 define-partial-eval
|
] 1 define-partial-eval
|
||||||
|
|
||||||
|
! Eliminates a few redundant checks here and there
|
||||||
|
\ both-fixnums? [
|
||||||
|
in-d>> first2 [ value-info class>> ] bi@ {
|
||||||
|
{ [ 2dup [ fixnum classes-intersect? not ] either? ] [ [ 2drop f ] ] }
|
||||||
|
{ [ 2dup [ fixnum class<= ] both? ] [ [ 2drop t ] ] }
|
||||||
|
{ [ dup fixnum class<= ] [ [ drop fixnum? ] ] }
|
||||||
|
{ [ over fixnum class<= ] [ [ nip fixnum? ] ] }
|
||||||
|
[ f ]
|
||||||
|
} cond 2nip
|
||||||
|
] "custom-inlining" set-word-prop
|
||||||
|
|
Loading…
Reference in New Issue