From 6c7005d588b56ea9e3471b3e1bdc952fd5283d87 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 5 Dec 2008 01:50:14 -0600 Subject: [PATCH] Tweak inlining heuristic --- basis/compiler/tree/propagation/inlining/inlining.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/compiler/tree/propagation/inlining/inlining.factor b/basis/compiler/tree/propagation/inlining/inlining.factor index 3a94029756..87a908041e 100644 --- a/basis/compiler/tree/propagation/inlining/inlining.factor +++ b/basis/compiler/tree/propagation/inlining/inlining.factor @@ -128,8 +128,8 @@ DEFER: (flat-length) 45 node-count get [-] 8 /i ; : body-length-bias ( word -- n ) - [ flat-length ] [ inlining-count get at 0 or 2/ 1+ ] bi * - 24 swap [-] 4 /i ; + [ flat-length ] [ inlining-count get at 0 or ] bi + over 2 <= [ drop ] [ 2/ 1+ * ] if 24 swap [-] 4 /i ; : inlining-rank ( #call word -- n ) [ classes-known? 2 0 ? ]