Lifetime analysis for procedure parameters

  • U. Kastens
  • M. Schmidt
Optimized Language Implementation
Part of the Lecture Notes in Computer Science book series (LNCS, volume 213)


Procedural abstraction is an important concept for functional and imperative programming as well. Compilers should implement procedures and calls as efficient as possible. This paper addresses techniques for both memory and runtime improvements of procedure calls. Usual implementations allocate storage for local objects of procedures (i.e. parameters, result and local variables) either in activation records on a runtime stack in the case of recursive procedures or in a global storage area otherwise. We show that objects of recursive procedures can also be allocated globally, if certain conditions on their lifetime are met. We present a method for systematic lifetime analysis based on a context-free grammar which describes the calling structure of the program. It is introduced for a simple functional language and then extended to cover further commom language properties. Furthermore it is shown that the method can nicely be combined with context dependent improvements of the compilation of calling sequences, e.g. for tail recursive calls.


Activation Record Recursive Procedure Return Address Calling Sequence Lifetime Analysis 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. [AU 78]
    Aho, A.V., Ullman, J. D.: Principles of Compiler Design. Addison Wessley (1978)Google Scholar
  2. [BW 82]
    Bauer, F.L., Wössner, H.: Algorithmic Language and Program Development. Springer Verlag (1982)Google Scholar
  3. [DB 76]
    Darlington, J., Burstall, R.M.: A System Which Automatically Improves Programs. Acta Informatica 6 (1976), pp. 41–60CrossRefGoogle Scholar
  4. [Ha 75]
    Haskell, R.: Efficient Implementation of a Class or Recursively Defined Functions. The Computer Journal, Vol. 18 No. 1, pp. 23–29Google Scholar
  5. [Ka 84]
    Kastens, U.: The GAG-System —A Tool for Compiler Construction. in Lorho, B. (ed): Methods and Tools for Compiler Construction, Cambridge University Press, 165–181Google Scholar
  6. [KHZ 82]
    Kastens, U., Hutt, B., Zimmermann, E.: GAG: A Practical Compiler Generator. LNCS 141 (1982)Google Scholar
  7. [St 77]
    Steele, G.L.: Debunking the Expensive Procedure Call" Myth.... Proc. of the ACM Nat. Conf., pp. 153–162 (1977)Google Scholar
  8. [WG 84]
    Waite, W.M., Goos, G.: Compiler Construction. Springer Verlag (1984)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1986

Authors and Affiliations

  • U. Kastens
    • 1
  • M. Schmidt
    • 1
  1. 1.Universität-GH PaderbornPaderborn

Personalised recommendations