[MLton] profiling and tail calls

Stephen Weeks MLton@mlton.org
Fri, 19 Nov 2004 10:27:41 -0800


> > Wouldn't a better way than using Leave calls be simply to put enter calls
> > just after all non-tail calls?  I.e., you never leave, you just re-enter
> > your caller.  This would keep everything tail-recursive (or not) and would
> > probably decrease the number of calls to these routines as a nice side effect.
>
> IIRC, Enter/Leave are never "called" as functions.  They are just
> syntactic markers in CoreML / XML / SXML / SSA.  

Right.  Another reason we do it the way we do is so that we can keep
track of the entire call stack, not just the current function.  With
only Enter's, you can't do that.