Never inline default methods, and fix inlining of methods with hints
parent
0f26d02d41
commit
ec49307c88
|
@ -3,7 +3,7 @@
|
||||||
USING: accessors kernel arrays sequences math math.order
|
USING: accessors kernel arrays sequences math math.order
|
||||||
math.partial-dispatch generic generic.standard generic.math
|
math.partial-dispatch generic generic.standard generic.math
|
||||||
classes.algebra classes.union sets quotations assocs combinators
|
classes.algebra classes.union sets quotations assocs combinators
|
||||||
words namespaces continuations classes fry combinators.smart
|
words namespaces continuations classes fry combinators.smart hints
|
||||||
compiler.tree
|
compiler.tree
|
||||||
compiler.tree.builder
|
compiler.tree.builder
|
||||||
compiler.tree.recursive
|
compiler.tree.recursive
|
||||||
|
@ -136,12 +136,10 @@ DEFER: (flat-length)
|
||||||
[
|
[
|
||||||
[ classes-known? 2 0 ? ]
|
[ classes-known? 2 0 ? ]
|
||||||
[
|
[
|
||||||
{
|
|
||||||
[ body-length-bias ]
|
[ body-length-bias ]
|
||||||
[ "default" word-prop -4 0 ? ]
|
|
||||||
[ "specializer" word-prop 1 0 ? ]
|
[ "specializer" word-prop 1 0 ? ]
|
||||||
[ method-body? 1 0 ? ]
|
[ method-body? 1 0 ? ]
|
||||||
} cleave
|
tri
|
||||||
node-count-bias
|
node-count-bias
|
||||||
loop-nesting get 0 or 2 *
|
loop-nesting get 0 or 2 *
|
||||||
] bi*
|
] bi*
|
||||||
|
@ -172,7 +170,7 @@ SYMBOL: history
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
: inline-word ( #call word -- ? )
|
: inline-word ( #call word -- ? )
|
||||||
dup def>> inline-word-def ;
|
dup specialized-def inline-word-def ;
|
||||||
|
|
||||||
: inline-method-body ( #call word -- ? )
|
: inline-method-body ( #call word -- ? )
|
||||||
2dup should-inline? [ inline-word ] [ 2drop f ] if ;
|
2dup should-inline? [ inline-word ] [ 2drop f ] if ;
|
||||||
|
@ -181,7 +179,9 @@ SYMBOL: history
|
||||||
{ curry compose } memq? ;
|
{ curry compose } memq? ;
|
||||||
|
|
||||||
: never-inline-word? ( word -- ? )
|
: never-inline-word? ( word -- ? )
|
||||||
[ deferred? ] [ { call execute } memq? ] bi or ;
|
[ deferred? ]
|
||||||
|
[ "default" word-prop ]
|
||||||
|
[ { call execute } memq? ] tri or or ;
|
||||||
|
|
||||||
: custom-inlining? ( word -- ? )
|
: custom-inlining? ( word -- ? )
|
||||||
"custom-inlining" word-prop ;
|
"custom-inlining" word-prop ;
|
||||||
|
|
Loading…
Reference in New Issue