--- gforth/profile.fs 2004/08/23 14:03:52 1.2 +++ gforth/profile.fs 2007/12/31 18:40:24 1.4 @@ -6,7 +6,7 @@ \ Gforth is free software; you can redistribute it and/or \ modify it under the terms of the GNU General Public License -\ as published by the Free Software Foundation; either version 2 +\ as published by the Free Software Foundation, either version 3 \ of the License, or (at your option) any later version. \ This program is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ \ GNU General Public License for more details. \ You should have received a copy of the GNU General Public License -\ along with this program; if not, write to the Free Software -\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. +\ along with this program. If not, see http://www.gnu.org/licenses/. \ relies on some Gforth internals @@ -28,13 +27,30 @@ true constant count-calls? \ do some profiling of colon definitions etc. +\ for true COUNT-CALLS?: + +\ What data do I need for evaluating the effectiveness of (partial) inlining? + +\ static and dynamic counts of everything: + +\ original BB length (histogram and average) +\ BB length with partial inlining (histogram and average) +\ since we cannot partially inline library calls, we use a parameter +\ that represents the amount of partial inlining we can expect there. +\ number of tail calls (original and after partial inlining) +\ number of calls (original and after partial inlining) +\ reason for BB end: call, return, execute, branch + +\ how many static calls are there to a word? How many of the dynamic +\ calls call just a single word? + struct cell% field profile-next cell% 2* field profile-count cell% 2* field profile-sourcepos cell% field profile-char \ character position in line count-calls? [if] - cell% field profile-colondef? \ is this a colon definition + cell% field profile-colondef? \ is this a colon definition start cell% field profile-calls \ static calls to the colon def cell% field profile-straight-line \ may contain calls, but no other CF cell% field profile-calls-from \ static calls in the colon def @@ -155,8 +171,8 @@ Defer before-word-profile ( -- ) r> ! ; \ change hook behaviour hook-profiling-into then-like -\ hook-profiling-into if-like -\ hook-profiling-into ahead-like +\ hook-profiling-into if-like \ subsumed by other-control-flow +\ hook-profiling-into ahead-like \ subsumed by other-control-flow hook-profiling-into other-control-flow hook-profiling-into begin-like hook-profiling-into again-like