JVM-bytecode execution engine and jvm-bytecode Engine

Source: Internet
Author: User

JVM-bytecode execution engine and jvm-bytecode Engine
Virtual Machine bytecode execution engine

I. runtime stack frame structure

1. Stack Frame is a data structure used to support Virtual machines for calling and Method execution. It is a Stack element of Virtual Method Stack in the Data zone during Virtual machine running hours, stack frames store information such as the method's local variable table, operand stack, dynamic connection, and method return address.

2. Local Virtual Table)

A local variable table is a storage space for variable values. It is used to store local variables defined in parameters and methods.

The local Variable table capacity is measured in the smallest unit of Variable Cao (Variable Slot. Slot should be able to store data of a Boolean, byte, char, short, int, float, reference or returnAddress type variable.

The virtual machine uses the local variable table through index positioning. The index value range is from 0 to the maximum number of slots in the local variable table.

During method execution, the virtual machine uses a local variable table to pass parameters to the parameter list.

3. Operand Stack)

The operand stack is also known as an operation station. It is a back-in-first-out (LILO) stack.

When a method is just started, its operand stack is empty, during the execution of the method, various bytecode commands are used to write and extract content into the operand stack, that is, the out stack and In-stack operations.

 

4. Dynamic connection

Each stack frame contains a reference pointing to the method to which the stack frame belongs in the runtime pool. The reference is held to support Dynamic connection (Dynamic Linking) during the call process ).

  

5. Method return address

When a method execution engine encounters a bytecode instruction returned by any method, the returned value may be passed to the upper-layer method caller, whether the return value and return value type are determined based on the method returned command. This exit method is called the exit of normal completion.

Another way to exit is to encounter an exception during method execution and the exception is not processed within the method body, regardless of the exception generated inside the Java Virtual Machine, or exceptions generated by using the athrow bytecode command in the Code. If no matching exception processor is found in the exception table of this method, the method exits, this exit method is called an exit with an exception.

 

Ii. method call

Parsing and calling must be a static process, which is completely determined during compilation. During the parsing phase of class loading, all the symbolic references involved will be converted into deterministic direct references, it will not be delayed until running.

Another method call is to dispatch the call.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.