CSCI 310 Spring 2005 Day 25

  1. Administrivia
    1. PL: 10:30?
    2. Project 4 demos

  2. Frames
    1. Given code, walk through the process and layout the frames.

    2. Using registers and doing parameter passing.
      • We try to pass everything in registers instead of using the stack.
      • so the stack is a "dump as necessary" area.
      • What we can put in registers depends on the architecture.
      • MIPS has, among others, registers
        1. function result (V0)
        2. arguments (A0 - A3)
        3. caller-saved registers (registers you need to dump if you don't want to lose the info) T1-T8
        4. callee-saved registers S0-S8
        5. static link (for the this parameter) (SL)
        6. stack pointer (SP)
        7. Frame pointer (FP) (callee-save)
        8. return address (RA)

  3. Implementing the Frame class
    1. The issues
      • want it to be semi-architecture independent
      • there's a Frame class holding info about
      • Accesses which represent space for locals and params.
      • Accesses may be stored in the frame, or in the registers. [When *must* it be in the frame rather than register?]
      • but we don't want to commit particular registers yet!
      • and that means we just track "temporary" addresses/registers, and "labels" to track labels we'll want in machine language (like method names).

    2. Walk through some code; turn it into an AST; decide how to visit it and assign Frames to each method.

Gary Lewandowski
Last modified: Wed Mar 16 09:49:09 EST 2005