The class file binary character stream is loaded into memory (method area) through the ClassLoader and virtual machines. After the layout and initialization of the memory, the virtual machine bytecode execution engine can execute the functions defined by the relevant code implementation program. The object that the virtual machine execution engine executes is a method, especially a non-local method, by
A carrier of a function defined by a program that implements predetermined business functions or specific functions.
The execution of a method within the Java Virtual machine memory specifically divides a region, the virtual machine stack. The stack frame structure is used in the virtual machine stack to store the local variables required by the calling method and the execution method, the operand stack, the method return value, etc., and the order of execution of the method is represented by the stack frame's access stack.
1, stack frame structure: How to store the contents of the method inside the virtual machine, the representation of the method within the virtual machine
Stack frame composition |
Purpose, function, function |
Characteristics |
Other |
Local variable table |
|
|
|
Operation Stack |
|
|
|
Dynamic connection |
|
|
|
return address |
|
|
|
Additional Information |
|
|
|
2, Method Invocation: Parsing method of symbolic reference and determine the version of the method
(1) Virtual and non-virtual methods
(2) Analysis
(3) Allocation
3. How does the virtual machine execute the method? How the virtual machine execution engine works
Reread "in-depth understanding of Java Virtual Machines" v. How do virtual machines execute bytecode? How the virtual machine execution engine works