当前位置:网站首页>Property table collection of JVM virtual machine class file

Property table collection of JVM virtual machine class file

2020-11-13 11:35:43 Kill one in ten steps_ Never leave a journey for thousands of m

One 、 summary

stay class In file , The property sheet set includes Java Virtual machine pre specification defined properties and user-defined properties , For user-defined properties , When the virtual machine is loaded, it will automatically ignore .class file 、 Field table 、 Method tables can carry their own set of property tables , It is convenient to describe the specific information of some scenes .

Two 、 form

The predefined properties in a virtual machine are :

The attribute name Use location meaning
Code Method table Java Bytecode instructions compiled by code
ConstantValue Field table final Constant pool defined by keyword
Deprecated class , Method , Field table Be declared deprecated Methods and fields
 Exceptions Method table   The exception thrown by the method  
 EnclosingMethod Class file   Only when a class is local or anonymous can it have this property , This property is used to identify the peripheral methods of this class  
 InnerClass Class file   Inner class list  
 LineNumberTable Code attribute   Java Source line number and bytecode instructions corresponding relationship  
 LocalVariableTable Code attribute   Part of the method is wolf description  
 StackMapTable Code attribute   JDK1.6 New properties in , For the new type checker to check and process whether the local variables and operands of the target method match the required classes  
 Signature class , Method table , Field table     Used to support method signature in the case of generics
 SourceFile Class file   Record source file name  
 SourceDebugExtension Class file   For storing additional debugging information  
 Synthetic class , Method table , Field table   Flag methods or fields are generated automatically by the compiler  
 LocalVariableTypeTable class   Use signature instead of descriptor , It is added to describe generic parameterized types after the introduction of generic syntax  
 RuntimeVisibleAnnotations class , Method table , Field table   Support for dynamic annotation  
 RuntimeInvisibleAnnotations surface , Method table , Field table   Used to indicate which annotations are not visible at run time  
 RuntimeVisibleParameterAnnotation Method table   The functions and RuntimeVisibleAnnotations Properties are similar to , It's just a method
 RuntimeInvisibleParameterAnnotation    Method table   The functions and RuntimeInvisibleAnnotations Properties are similar to , Which action object is the method parameter
 AnnotationDefault   Method table Used to record the default values of annotation class elements  
 BootstrapMethods Class file   Used to hold invokeddynamic Boot mode qualifier for instruction reference   

Structure of property sheet attribute_info

attribute_info{
    attribute_name_index// The name index of the property ( Point to constant pool )2 Bytes 
    attribute_length// Attribute length  4 Bytes 
    info// Yes attribute_length Byte property value 
}

3、 ... and 、 Introduction to common properties

Code attribute

Exceptions attribute

LineNumberTable attribute

LocalVariableTable attribute

SourceFile attribute

ConstantValue attribute

InnerClass attribute

This part of the property sheet has more contents , It's a little bit more complicated , Let's record it here for now .

Reference material :

  1. https://www.cnblogs.com/lrh-xl/p/5351182.html
  2. https://blog.csdn.net/xiaoqiu_cr/article/details/86774074
  3. https://blog.csdn.net/qq_38526573/article/details/88541241

版权声明
本文为[Kill one in ten steps_ Never leave a journey for thousands of m]所创,转载请带上原文链接,感谢

随机推荐