Week 9

Exercises on code generation

  1. Discuss what a good strategy for computing the stack limit could be.

    Motivation: get you thinking about the stack limit computation before the upcoming deliverable.

  2. Provide an appropriate code template for the for-loop, which could be used if we no longer handled it as syntactic sugar.

    Motivation: gain experience with writing somewhat complex code templates.

  3. Change the code template for !E (on slide 19) to compute the result as 1-E. Include a diff for necessary modifications to the JOOS compiler.

    Motivation: gain experience with implementing code templates.

  4. (Optional.) Study the code for generating code for JOOS programs. Is anything unclear?

    Motivation: as before, the JOOS compiler is an excellent reference for your own WIG compiler.

Maintained by Christopher J. F. Pickett. [HOME]