Reading Exercise #3
Due 4:00 PM, Tuesday Jan. 28, 2014

Content of reading exercise #3

  1. Explain how can we be sure that a subroutines lexically surrounding routine is active even if the subroutine was not called directly by the surrounding routine.
  2. During a subroutine call and execution, which tasks are handled by the caller and which are handled by the callee? Why do you think these tasks are divided in this way?
  3. In the calling conventions for MIPS and x86 processors, what kinds of things are typically stored in caller-saves and callee-saves registers?
  4. Compare and contrast the differences in the RISC and CISC calling conventions. What do you think the reasons are for these differences?
  5. How does in-line expansion work and what are its advantages/disadvantages?
  6. Explain how the call-by-reference, call-by-value, call-by-value/result, and call-by-sharing work. Why might each of these conventions be used?
  7. When and why is it necessary to pass a closure as a parameter?
  8. What are the three types of operations that exception handlers tend to perform?
  9. How do exception handlers in imperative and functional languages differ?