On the calling behaviour of procedures
If a procedure P is relatively nonrecursive with respect to a procedure Q, i.e., P is always preceded by Q in the calling graph of the program, then P does not need an activation record of its own — it can be integrated into that of Q. Thus, the efficiency of a call to P is between that of a strictly recursive and a nonrecursive one.
An algorithm is presented which classifies each procedure (or function) in a program as being either nonrecursive, relatively nonrecursive or strictly recursive (i.e., recursive but not relatively nonrecursive) and associates each relatively nonrecursive with a strictly recursive one.
The method is based on finding dominators in the (transformed) calling graph.
KeywordsTransitive Closure Activation Record Main Program Recursive Procedure Calling Behaviour
Unable to display preview. Download preview PDF.
- [AU79]Alfred V. Aho, Jeffrey D. Ullman: Principles of Compiler Design, Chapter 13, Addison-Wesley Publishing Company, third Printing, April 1979Google Scholar
- [LAN73]Hans Langmaack: On Correct Procedure Parameter Passing in Higher Programming Languages Acta Informatica 2, 110–142 (1973)Google Scholar
- [WAL76]Kenneth G. Walter: Recursion Analysis for Compiler Optimization Communications of the ACM, September 1976, Volume 19, Number 9, 514–516Google Scholar