Documente Academic
Documente Profesional
Documente Cultură
STRATEGIES
Sreel
aj
DIFFERENT WAYS TO ALLOCATE OBJECTS
E.g.: Fortran
FORTRAN
A Fortran compiler might place the activation
record for a procedure together with the code
for that procedure.
In some systems it is possible to use link
editor to link activation records and
executable code.
STACK ALLOCATION
Storage is organized as a stack
Activation records are pushed and popped as
activation begin and end
Storage for locals in each call of a procedure
is contained in the activation record for that
call
The values of locals are deleted when the
activation ends
A register can be used to mark the top of
stack. At run time an activation record can be
allocated and de-allocated by incrementing
and decrementing register.
CALLING SEQUENCES
For implementing procedure calls.
A call sequence allocates an activation
record and entries information into its fields.
A return sequence restores the state of the
machine so the calling procedure can
continue execution.
CALLING SEQUENCES
The code in a calling sequence is often
divided between the calling procedure and
the procedure it calls
Usually fixed size fields are placed in the
middle
Temporary fields are often stored after local
data to a procedure so that changes in its
size will not affect the offsets of data objects
DIVISION OF TASKS BETWEEN CALLER
AND CALLEE