In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
It is believed that many inexperienced people do not know what to do about the composition and use of the JVM instruction system. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
This paper introduces the concept and usage of JVM instruction system. JVM instruction system is designed for the implementation of Java language, which contains instructions for calling methods and monitoring multi-precedent systems.
JVM instruction system
The JVM instruction system is very similar to the instruction system of other computers. The Java instruction is also composed of opcodes and operands. The opcode is an 8-bit binary number, the Operand is immediately following the opcode, and its length varies according to needs. Opcodes are used to specify the nature of an instruction operation (described here in the form of assembly symbols), such as iload for loading an integer from memory, anewarray for allocating space for a new array, iand for the "and" of two integers, and ret for process control to indicate a return from a call to a method. When the length is greater than 8 bits, the Operand is divided into more than two bytes.
JVM uses "big endian" encoding to deal with this situation, that is, high-order bits is stored in low bytes. This is consistent with the encoding adopted by Motorola and other RISC CPU, but different from the "little endian" encoding adopted by Intel, that is, the low-order bits is stored in the low-order bytes.
The JVM instruction system is designed for the implementation of the Java language, which contains instructions for calling methods and monitoring multi-precedent systems. The length of Java's 8-bit opcodes makes JVM have up to 256 instructions, and more than 160 opcodes have been used.
All CPU contain a register group that holds the system state and the information required by the processor. If the virtual machine defines more registers, you can get more information from it without having to access the stack or memory, which helps to improve the running speed. However, if there are more registers in the virtual machine than in the actual CPU, it will take up a lot of time for the processor to simulate the registers with conventional memory, which will reduce the efficiency of the virtual machine. In response to this situation, JVM sets only the four most commonly used registers. They are:
◆ pc program counters
◆ optop Operand stack top pointer
◆ frame current execution environment pointer
Vars pointers to * local variables in the current execution environment all registers are 32 bits. Pc is used to record the execution of the program. Optop,frame and vars are used to record pointers to the Java stack area.
After reading the above, have you mastered the composition of the JVM instruction system and how to use it? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.