]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge git://github.com/littledan/Factor into littledan
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 30 Jan 2010 13:54:58 +0000 (02:54 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Sat, 30 Jan 2010 13:54:58 +0000 (02:54 +1300)
1  2 
basis/compiler/tree/propagation/transforms/transforms.factor

index e95c6c4a4978b4304c013e064d262e7e07dbc88b,2d145ef74f637265b300fd14ad350f1ea6229433..da3bd58f74da06478f1cfb24cadd54c8828b7ea7
@@@ -163,12 -163,10 +163,12 @@@ ERROR: bad-partial-eval quot word 
  
  : inline-new ( class -- quot/f )
      dup tuple-class? [
 -        dup inlined-dependency depends-on
 -        [ all-slots [ initial>> literalize ] map ]
 -        [ tuple-layout '[ _ <tuple-boa> ] ]
 -        bi append >quotation
 +        dup tuple-layout
 +        [ depends-on-tuple-layout ]
 +        [ drop all-slots [ initial>> literalize ] [ ] map-as ]
 +        [ nip ]
 +        2tri
 +        '[ @ _ <tuple-boa> ]
      ] [ drop f ] if ;
  
  \ new [ inline-new ] 1 define-partial-eval
@@@ -284,6 -282,15 +284,15 @@@ CONSTANT: lookup-table-at-max 25
  
  \ intersect [ intersect-quot ] 1 define-partial-eval
  
+ : fixnum-bits ( -- n )
+     cell-bits tag-bits get - ;
+ : bit-quot ( #call -- quot/f )
+     in-d>> second value-info interval>> 0 fixnum-bits [a,b] interval-subset?
+     [ [ >fixnum ] dip fixnum-bit? ] f ? ;
+ \ bit? [ bit-quot ] "custom-inlining" set-word-prop
  ! Speeds up sum-file, sort and reverse-complement benchmarks by
  ! compiling decoder-readln better
  \ push [
  ! calls when a C type is redefined
  \ heap-size [
      dup word? [
 -        [ inlined-dependency depends-on ] [ heap-size '[ _ ] ] bi
 +        [ depends-on-definition ] [ heap-size '[ _ ] ] bi
      ] [ drop f ] if
  ] 1 define-partial-eval