compiler: inline singleton predicates, and optimize predicate engines, reduces terrain demo deployed size by ~20kb
parent
66afcff1e0
commit
79a3f6b0d5
|
@ -120,7 +120,7 @@ M: predicate-engine-word no-compile? "owner-generic" word-prop no-compile? ;
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
: optimize? ( word -- ? )
|
: optimize? ( word -- ? )
|
||||||
{ [ predicate-engine-word? ] [ single-generic? ] } 1|| not ;
|
single-generic? not ;
|
||||||
|
|
||||||
: contains-breakpoints? ( -- ? )
|
: contains-breakpoints? ( -- ? )
|
||||||
dependencies get keys [ "break?" word-prop ] any? ;
|
dependencies get keys [ "break?" word-prop ] any? ;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2008, 2009 Slava Pestov.
|
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel accessors sequences words memoize combinators
|
USING: kernel accessors sequences words memoize combinators
|
||||||
classes classes.builtin classes.tuple math.partial-dispatch
|
classes classes.builtin classes.tuple classes.singleton
|
||||||
fry assocs combinators.short-circuit
|
math.partial-dispatch fry assocs combinators.short-circuit
|
||||||
compiler.tree
|
compiler.tree
|
||||||
compiler.tree.combinators
|
compiler.tree.combinators
|
||||||
compiler.tree.propagation.info
|
compiler.tree.propagation.info
|
||||||
|
@ -45,6 +45,7 @@ M: predicate finalize-word
|
||||||
"predicating" word-prop {
|
"predicating" word-prop {
|
||||||
{ [ dup builtin-class? ] [ drop word>> cached-expansion ] }
|
{ [ dup builtin-class? ] [ drop word>> cached-expansion ] }
|
||||||
{ [ dup tuple-class? ] [ drop word>> def>> splice-final ] }
|
{ [ dup tuple-class? ] [ drop word>> def>> splice-final ] }
|
||||||
|
{ [ dup singleton-class? ] [ drop word>> def>> splice-final ] }
|
||||||
[ drop ]
|
[ drop ]
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue