
16 An Introduction to Compiler Construction in a Java World
FIGURE 1.10 Run-time stack frames in the JVM.
In both frames, locations are set aside for n formal parameters and m local variables;
n, m, or both may be 0. In the stack frame for a static method, these locations are allocated
at offsets beginning at 0. But in the invocation of an instance method, the instance itself, that
is, this, must be passed as an argument, so in an instance method’s stack frame, location
0 is set aside for this, and parameters and local variables are allocated offset positions
starting at 1. The areas marked “computations” in the frames are memory locations set
aside