The structure of the JVM overview 2

Frames

Local Variables

Each frame contains an array of variables known as its local variables.

  • one can hold
    >
    boolean, byte, char, short, int,
    float, reference, returnAddress

  • a pair can hold long or double

JVM uses local variables to pass parameters on method invocation.

On instance method invocation, local variable 0 is always used to pass
a reference to instance it’self(this).

Operand Stacks

Each frame contains a last-in-first-out (LIFO) stack known as its operand stack.

Used to push or pop constant or values from variable or method.

Values from the operand stack must be operated upon in ways appropriate to their types.

These restrictions on operand stack manipulation are enforced through class file verification.

Dynamic Linking

Each frame contains a reference to the run-time constant pool for
the type of the current method to support dynamic linking of the method code.

invoke InvocationHandler in java ?

Used to reduce the invasive of the code linked code,
keep current code shape and solid.

Dynamic linking translates these symbolic method references into concrete method references.

Normal Method Invocation Completion

A method invocation completes normally if
that invocation does not cause an exception to be thrown.

The current frame use break characteristic to restore the state of the invoker
for the program counter of the invoker appropriately incremented to skip past
the method invocation instruction(PC Register?).

Abrupt Method Invocation Completion

A method invocation completes abruptly if execution of a JVM
instruction within the method causes the JVM to throw an
exception, and that exception is not handled within the method.

Execution of an athrow instruction also causes an exception to
be explicitly thrown and, if the exception is not caught by the
current method, results in abrupt method invocation completion.

A method invocation that completes abruptly never returns a value to its invoker.