Page 20: The occurrence of val rlnew = zip(params,el) should be val rlnew = zip(params,vl) (* new local env *) Page 21: JVM interpreter: The two occurrences of "dmem[FP-(PC++)]" should of course be "dmem[FP-imem[PC++]]" (use the byte in the instruction stream addressed by PC as the offset from FP". *SLIDE 44* ("How to write a JVM interpreter (4)") For nit-picking correctness, the last line of the "invokestatic" code FP = SP should rather be the two lines: FP = SP + n_p; (make iload0 get 1st parameter) SP = SP - n_v; (make SP point to free space beyond local vars) Here n_p is the number of parameters to the function and n_v the number of local variables -- in .class files these are sadly stored in metadata (rather than in the logical place as an instruction ENTER n_p,n_v occurring at the start of the functon's code). Page 55: The diagrams not only use an upward-growing stack, but use a slightly different model of where the linkage information goes. So, here is a text form of how the pictures should look: Section 11.1 -- pictures for descending stack. These are now consistent with the figures on page 15 and 16 of the notes. First figure: [highest address] [stack frame for G] [linkage info] S: static link (frame of G's definer) RA: instruction following call to G FP': frame of G's caller <<<<<<<<<< FP register points here ($$) [end linkage info] [local variables] a 1 b 2 (note f is a closure which are two words (pointers) long) f pointer to code f pointer to frame of f's definer (this is G, so $$ above) [end local variables] [arguments to f] 4 5 [end arguments to f] [end frame for G] [lowest address] Second figure: [highest address] [stack frame for G] [linkage info] S: static link (frame of G's definer) RA: instruction following call to G FP': frame of G's caller ($$) [end linkage info] [local variables of G] a 1 b 2 f pointer to code f pointer to frame of f's definer (this is G, so $$ above) [end local variables] [arguments to f] 4 5 [end arguments to f] [end frame for G] [stack frame for f] [linkage info] S: static link (frame of f's definer -- i.e. $$ above) RA: instruction following call to f FP': frame of f's caller (also $$ above) <<<< FP reg now points here. [end linkage info] [local variables of f] [end local variables] [end frame for f] [lowest address]