Accessing instance variables and invoking methods
- An instance variable is placed always at the same offset.
- The address of a method is placed always at the same offset
in the method table.
- The offsets are determined by the compiler (to machine language).
- The compiler can produce very efficient code to access an instance:
one machine instruction.
- The compiler can produce efficient code to invoke a method: a constant
number of machine instructions (plus parameter passing).
- 3 -