10-01: Static vs. Dynamic Typing

11-03: Activation Records

The information needed to manage one procedure activation is called an activation record (AR) or frame.

11-06: Stack Machines

  1. Only storage is a stack;
  2. An instruction r=F(a1...an):r = F(a_1 ... a_n):
    • Pops n operands from the stack;
    • Computes the operation F using the operands;
    • Pushes the result r on the stack.
  3. An n-register stack machine:
    • Conceptually, keep the top n locations of the pure stack machine’s stack in registers.
  4. Consider a 1-register stack machine:
    • The register is called the accumulator.
  5. Algorithm:
    • Consider an expression op(e1...en)op(e_1 ... e_n):
      1. Note e1...ene_1 ... e_n are subexpressions.
    • For each ei(0<i<n)e_{i(0 < i < n)}:
      1. Compute eie_i;
      2. Push result on the stack.
    • Pop n - 1 values from the stack, compute op;
    • Store result in the accumulator.