In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
In this article Xiaobian for you to introduce in detail "how the structure of the jvm class file is", the content is detailed, the steps are clear, the details are handled properly, I hope that this article "how the structure of the jvm class file is" can help you solve your doubts, following the editor's ideas slowly in-depth, let's learn new knowledge together.
Class file structure
A class file is a set of binary streams in 8-bit byte base units, and each data item is arranged in a compact order in the class file.
The class file format uses pseudo code similar to the C language structure to store data, in which there are only unsigned numbers and tables.
Unsigned numbers belong to the basic data type, and u1, 2, 4 and 8 bytes represent unsigned numbers of 1 byte, 2 bytes, 4 bytes and 8 bytes respectively.
Unsigned can be used to describe numbers, index references, quantity values, or string values according to utf-8 coding.
A table is a compound data type consisting of multiple unsigned or other tables as data items, and tables usually end with "_ info"
The byte order in the class file is Big-Endian (large end mode and small end mode)
Big-end mode means that the low bit of data is stored in the high address of memory, while the high bit of data is stored in the low address of memory.
The small end mode means that the low order of the data is stored in the low address of the memory, while the high order of the data is stored in the high address of the memory.
The first four bytes of the class file are called Magic Number, and it is used to determine whether the file is a class file accepted by a virtual machine.
Constant pool
A constant pool is a repository of class files.
The constant pool mainly stores two types of constants, literal quantities (Literal) and symbolic references (Symbolic Reference).
Literals are similar to constant concepts at the Java language level, such as text strings, constant values declared as final, etc.
Symbol reference belongs to the category of compilation principle.
a. Fully qualified names of classes and interfaces
b. Names and description symbols such as fields
c. Method name and descriptor
Access flag
Magic number-the "constant" constant ends, followed by two bytes representing an access flag (access_flags), which is used to identify access information such as a class or interface hierarchy. (whether class is a class or interface, whether it is a public type, whether it is an abstract type, whether it is declared as final)
After reading this, the article "what is the structure of the jvm class file" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.
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.