Q6Compiler Design
Question
2 marks
Define Activation Record.
Answer
An Activation Record (stack frame) is a block of memory allocated on the runtime stack to hold information needed for a single execution (activation) of a procedure.
An Activation Record (also called a stack frame) is a contiguous block of memory allocated on the runtime stack each time a procedure is called. It holds all information needed for one invocation of the procedure. When the procedure returns, its activation record is deallocated.
- Return Value: Space for the value returned by the procedure.
- Actual Parameters: Values (or references) of arguments passed to the procedure.
- Control Link (Dynamic Link): Pointer to the activation record of the calling procedure.
- Access Link (Static Link): Pointer to the activation record of the lexically enclosing scope (for languages with nested procedures).
- Saved Machine Status: Contents of registers saved before the call (to be restored on return).
- Local Data: Memory for local variables of the procedure.
- Temporaries: Space for intermediate values during expression evaluation.