SOFTWARE-PRACTICE AND EXPERIENCE, zyxwvutsrq VOL. 11, 757-765 zyxwvut (1981) Parameter Passing Mechanisms and Run Time Data Structures TOMASZ KOWALTOWSKI* zyxwvu Departamento de Cisncia da Computa@o, Universidade Estadual de Campinas, Caixa Postal zyx 11 70, 131 00 Campinas, zyxwvut SP, Brazil SUMMARY The relationship between parameter passing mechanisms and run time data structures in languages with statically-nested scopes is examined. It is shown that simpler data structures can be used in some cases, with increased efficiency in accessing non-local variables. In particular it is true for the call-by-value-result mechanism, where the usage of displays can be eliminated altogether; however there is some additional cost associated with procedure calls. Under certain conditions the same implementation applies to call-by-reference. KEY WORDS Parameter passing mechanisms Display Run time data structure Implementation of programming languages INTRODUCTION Since the early implementations of Algol 60 the classical method for handling efficiently accesses to statically-nested non-local environments has been through the usage of displays. In this kind of implementation each procedure activation creates an independent data area, also called its activation record. The display is an auxiliary set of indexing registers which at any given time contain pointers to currently accessible activation records. Each procedure is associated with one position of the display, determined at compile time by its static nesting level. The activation records follow a LIFO discipline and thus can be allocated and deallocated in a stack-like fashion. Figure 1 shows the configuration of the display and of the data stack for a program outlined in Figure 2 (it is assumed that the statement being executed zyx is within the body of the procedure zyxwvut q). Procedure calls and corresponding returns involve changing the execution environment, i.e. setting up the appropriate display. These operations can be quite inefficient, especially in the case of a language such as Algol 60, which requires a very general solution in order to handle its parameter passing mechanisms. In this paper we examine the possibility of simplifying the run time data structures and their manipulation, under different parameter passing methods, without sacrific- ing however the efficiency of accessing variables. First we shall describe, for the sake of comparison, a general implementation which can handle all of Algol 60 mechanisms: call-by-value, call-by-name, procedures and labels as parameters. This kind of implementation has been used in most Algol 60 systems, and our description is based zy , *This paper was written while the author was visiting the Department of Computer Science of the University of California at Santa Barbara. Partial support was provided by the Brazilian National Council for Scientific and Technological Development (CNPq). 0038-0644/81/070757-09$01 .OO @ 1981 by John Wiley & Sons, Ltd. Received 20 March 1980 Revised 1 September 1980