GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 2.15

Constant-time access to lexical ancestors

Compiler Design · Runtime Environments & Parameter Passing · Full GATE CSE 1998 paper

GATE 1998, Q2.15 2 marks · MCQ
Report issue

Runtime Environments & Parameter Passing

Question 2.15, GATE 1998: An array of pointers to activation records used to speed nonlocal variable access is called stack, heap, display, or activation tree?
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

A display stores the current activation-record pointer for each lexical nesting level. A nonlocal variable’s declaration level and fixed offset then identify its address through one indexed display lookup plus the offset. This avoids following a chain of static links through multiple records. The structure is called a display, C. A stack stores records themselves, a heap supports general dynamic allocation, and an activation tree describes call relationships rather than this direct-access table.

Original paper, page 5