Activation Record
. temporaries: used in expression evaluation
|
 |
. local data: field for local data
|
. saved machine status: holds info about machine status before procedure call
|
. access link : to access non local data
|
. control link : points to activation record of caller
|
. actual parameters: field to hold actual parameters
|
. returned value : field for holding value to be returned
|
|
The activation record is used to store the information required by a single procedure call. Not all the fields shown in the figure may be needed for all languages. The record structure can be modified as per the language/compiler requirements. For Pascal and C, the activation record is generally stored on the run-time stack during the period when the procedure is executing.
Of the fields shown in the figure, access link and control link are optional (e.g. Fortran doesn't need access links). Also, actual parameters and return values are often stored in registers instead of the activation record, for greater efficiency.
The activation record for a procedure call is generated by the compiler. Generally, all field sizes can be determined at compile time. However, this is not possible in the case of a procedure which has a local array whose size depends on a parameter. The strategies used for storage allocation in such cases will be discussed in the coming slides.
|