Guide to lecture topics directly related to PA4
Fall 2006 [Bono]
There were five lectures where we discussed issues directly related to
your Espresso code generator.
As you are figuring out how to do various parts of the code-generator
you may find this guide helpful. I will try to relate here which
project-related topics we covered on which day to make it easier for
you to find information in your lecture notes or the online lecture
notes, or for you to rewatch part or all of a lecture if need be.
- 10/30 Run-time environments
- an example layout of generated code in memory (function by function).
- example of computing
offsets for formals and locals of a function.
- discussion and diagram
of the memory organization in MIPS architecture (stack, heap, etc.).
- 11/1 Run-time environments II
- activation records
- what happens in a call/return sequence
- example of code to access formals and locals using offsets from $fp
- discussion of how to access fields using "this"
- 11/6 Stack-machine code gen.
- discussed general idea of stack-machine: push and pop temps from stack
- presented a simple lang that we eventually did all codegen code for
- MIPS version of code gen for "+", and integer constants
- example of generating MIPS code for a control structure (if)
- discussed NameGenerator and emit functions
- 11/8 Stack-machine code gen. (cont.)
- discussed activation record layout for the simple language
- MIPS code for func call and func def for the simple language
- MIPS code to access a formal parameter in the a.r.
- present general "template" for what a generic C++ codegen method would look like
- 11/13 Code gen. for OO languages
- reviewed code for accessing fields and locals
- discussed "dummy" field in objects
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees