compiler.tree.propagation.transforms: open-code >fixnum when input is already a fixnum or f

db4
Slava Pestov 2010-04-18 22:36:52 -05:00
parent 1624903ae1
commit d143aa64b2
1 changed files with 14 additions and 7 deletions

View File

@ -1,12 +1,13 @@
! Copyright (C) 2008, 2010 Slava Pestov, Daniel Ehrenberg. ! Copyright (C) 2008, 2010 Slava Pestov, Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types kernel sequences words fry generic accessors USING: alien.c-types kernel sequences words fry generic
classes.tuple classes classes.algebra definitions generic.single accessors classes.tuple classes classes.algebra
stack-checker.dependencies quotations classes.tuple.private math definitions stack-checker.dependencies quotations
math.partial-dispatch math.private math.intervals sets.private classes.tuple.private math math.partial-dispatch math.private
math.floats.private math.integers.private layouts math.order math.intervals sets.private math.floats.private
vectors hashtables combinators effects generalizations assocs math.integers.private layouts math.order vectors hashtables
sets combinators.short-circuit sequences.private locals growable combinators effects generalizations assocs sets
combinators.short-circuit sequences.private locals growable
stack-checker namespaces compiler.tree.propagation.info ; stack-checker namespaces compiler.tree.propagation.info ;
FROM: math => float ; FROM: math => float ;
FROM: sets => set ; FROM: sets => set ;
@ -299,6 +300,12 @@ M\ set intersect [ intersect-quot ] 1 define-partial-eval
[ \ push def>> ] [ f ] if [ \ push def>> ] [ f ] if
] "custom-inlining" set-word-prop ] "custom-inlining" set-word-prop
! Speeds up fasta benchmark
\ >fixnum [
in-d>> first value-info class>> fixnum \ f class-or class<=
[ [ dup [ \ >fixnum no-method ] unless ] ] [ f ] if
] "custom-inlining" set-word-prop
! We want to constant-fold calls to heap-size, and recompile those ! We want to constant-fold calls to heap-size, and recompile those
! calls when a C type is redefined ! calls when a C type is redefined
\ heap-size [ \ heap-size [