|Recursion with register optimised parameters. firstname.lastname@example.org (1997-09-12)|
|Re: Recursion with register optimised parameters. email@example.com (Jonathan Eifrig) (1997-09-15)|
|From:||"Jonathan Eifrig" <firstname.lastname@example.org>|
|Date:||15 Sep 1997 21:22:47 -0400|
|Keywords:||optimize, functional, registers|
Craig Main <email@example.com> wrote:
> I was wondering how languages (like Delphi) handle recursion when their
> parameter passing is optimised to use the registers.
> It has been bugging me for some time now. The delphi inline assembler
> documentation states that under certain conditions a stack frame is not
> created for a procedure or function.
> [In most compilers, leaf procedures which don't need stack variables
> don't make a stack frame, other procedures all do. -John]
Well, usually "functional" languages like Lisp, Scheme, or ML will
implement tail recursion elimination, in which the caller's stack
frame is essentially recycled for use as the callee's stack frame.
Obviously, inlined functions don't use a stack frame.
The SML/NJ compiler is a continuation-based compiler, which converts
all control constructs into something very similar to tail recursive
functions, and the register-allocator will often assign variables to
registers so that function calls become just jumps. I'm not sure
that's what you're referring to, however, in your question about
"parameter passing optimized to use the registers."
- Jonathan Eifrig (firstname.lastname@example.org)
Return to the
Search the comp.compilers archives again.