compiler.tree.propagation.transforms: fix problem with 'shift' transform when input was a bignum
parent
b23ab401c8
commit
e46259bd33
|
@ -443,5 +443,7 @@ M: object bad-dispatch-position-test* ;
|
|||
[ -1 ] [ 3 4 0 dispatch-branch-problem ] unit-test
|
||||
[ 12 ] [ 3 4 1 dispatch-branch-problem ] unit-test
|
||||
|
||||
[ 1024 bignum ] [ 10 [ 1 >bignum swap >fixnum shift ] compile-call dup class ] unit-test
|
||||
|
||||
! Not sure if I want to fix this...
|
||||
! [ t [ [ f ] [ 3 ] if >fixnum ] compile-call ] [ no-method? ] must-fail-with
|
|
@ -100,8 +100,12 @@ IN: compiler.tree.propagation.transforms
|
|||
] each
|
||||
|
||||
! Speeds up 2^
|
||||
: 2^? ( #call -- ? )
|
||||
in-d>> first value-info
|
||||
{ [ literal>> 1 = ] [ class>> fixnum class<= ] } 1&& ;
|
||||
|
||||
\ shift [
|
||||
in-d>> first value-info literal>> 1 = [
|
||||
2^? [
|
||||
cell-bits tag-bits get - 1 -
|
||||
'[
|
||||
>fixnum dup 0 < [ 2drop 0 ] [
|
||||
|
|
Loading…
Reference in New Issue