Use the following questions to guage if you understand the material in lectures.
If you can answer all the questions after reading the book and listening to the
lecture, then you should be in good shape for the exams.
Lecture 11
Consider first a language model (similar to FORTRAN in the 1950's) were we have
(a) no recursion, (b) no nested procedures, (c) call by value parameters,
(d) fixed sized variables and no dynamic allocation (e) information about locals
only accessible when executing a procedure. We will then remove these restrictions
one by one and consider the implications.
-
The run-time space associated with every procedure is known as an activation
record (or activation frame). What three types of information is found in
this area?
-
What are the steps involved in calling a procedure?
-
How does one access local variables?
-
Suppose we allow access to both locals and global variables
(two levels of scope, as in C). Where are global variables found?
-
Suppose we allow call by reference parameters in place of call by value.
How does this change the memory layout? How does this change the calling
procedure?
-
Suppose now we allow recursion. What problem does this introduce?
How can it be solved? What important property of procedure calling
are we depending upon?
-
How are local variables now accessed?
-
How does the creation of an activation record change the calling
protocol? Which partner is in charge of creating which portion of the
activation record?