zoukankan      html  css  js  c++  java
  • [笔记] 深入java虚拟机 java class文件(2)

    attributes_info表

    attribute_name_index -- 属性名称的CONSTATNT_Utf8_info入口索引

    attrbute_length --

    info --

     

    Code_attribute

    method_info的属性表

    attribute_name_index -- 'Code'的CONSTATNT_Utf8_info入口索引

    attribute_length --

    max_stack -- 该方法的操作数栈的最大长度(以字为单位)

    max_locals -- 方法的局部变量所需存储空间的长度(以字为单位),存储方法的参数和局部变量

    code_length --

    code -- 方法的字节码

    exception_table_length --

    exception_table -- exception_info表列表,每一个表描述异常表项

    atributes_count --

    attributes -- attributes_info表列表,可以是LineNumberTable,LocalVariableTable

     

     (以下的所有attributes表中的attribute_name_index和attribute_length均省略)

    exception_info表

    star_pc -- 从代码数组起始到异常处理器起始处的偏移量

    end_pc -- 从代码数组起始到异常处理器结束后一个字节的偏移量

    handler_pc -- 从代码数组起始处跳转到异常处理器的第一条指令的偏移量

    catch_type -- 异常处理器所捕获的异常类型的CONSTANT_Class_info入口的索引,该入口必须描述java.lang.Throwable类或其子类,为0,则异常处理器将捕获所有的异常

     

    ConstantValue_attribute表

    常量的字段的field_info表中

    constantvalue_index -- 常量池中的常量值的入口索引

     

    Deprecated_attribute表

    method_info,field_info,ClassFile表中的attributes项中

    说明程序中禁用的method,field或class,用来支持@Deprecated注解

    attribute_name_index -- 'Deprecated'的CONSTATNT_Utf8_info入口索引

    attribute_length -- 0

     

    Exception_attribute表

    可能抛出异常的method_info表中

    number_of_exceptions -- exception_index_table数组个数

    exception_index_table -- 方法中throw自居中声明的异常类的常量池中CONSTAT_Class_info入口索引的数组

     

    InnerClasses_attribute表

    number_of_classes --

    classes -- inner_class_info表

     

    inner_class_info表

    innder_class_info_index -- 内嵌类在的常量池的CONSTANT_Class_info入口的索引

    outer_class_info_index -- 内嵌类的外围类类在的常量池的CONSTANT_Class_info入口的索引

    inner_name_index -- 非匿名内嵌类时为CONSTANT_Utf8_info入口的索引,该入口描述inner_class_info描述的类的名称,如果为匿名类则为0

    inner_class_acces_flags -- inner类的访问标志

    类A内嵌类B,类B内嵌类C

    则A的InnerClass_Attribute表中的inner_class_info表中

    innder_class_info_index -- 类A在常量池的CONSTANT_Class_info入口的索引

    outer_class_info_index -- 0(外围类为包时为0)

    inner_name_index -- ’A‘在常量池的CONSTANT_Utf8_info入口的索引

    inner_class_acces_flags --

    (以下描述部分省略

    则B的InnerClass_Attribute表中的inner_class_info表中

    innder_class_info_index -- A

    outer_class_info_index -- 0

     

    innder_class_info_index -- B

    outer_class_info_index -- A

     

    innder_class_info_index -- C

    outer_class_info_index -- B

     

    则C的InnerClass_Attribute表中的inner_class_info表中

    innder_class_info_index -- C

    outer_class_info_index -- B

     

    innder_class_info_index -- B

    outer_class_info_index -- A

     

    innder_class_info_index -- A

    outer_class_info_index -- 0

     

    LineNumberTable_attribute表

    line_number_table_length --

    line_number_table -- line_number_info表数组

     

    line_number_info表

    描述方法字节码偏移量和源代码行号之间的映射关系

    start_pc -- 新行开始时代码数组的偏移量

    line_number_number -- 行号

     

    LocalVariableTable_attribute表

    描述了方法的栈帧中局部变量部分内容与源代码中局部变量的名称和描述符之间的关系

    local_variable_table_length --

    local_variable_table -- local_viriable_info表数组

    local_viriable_info表

    建立源代码中局部变量的名称,类型和局部变量在字节码数组中的作用域,栈帧内局部变量中的索引之间的联系

    start_pc -- 代码数组中指令开始为值得偏移量

    length -- start_pc开始的所有局部变量有效的代码的长度

    name_index -- 局部变量名称的常量池的索引

    descriptor_index -- 描述符的常量池的索引

    index -- 方法栈帧中此局部变量的索引

    SourceFile_attribute表

    提供来产生class的源文件的名称

    sourcefile_index -- 源文件名称的常量池的索引,不包括目录路径

    Synthetic_attribute表

    指明了编译器所产生的字段,方法或者了性,未在源码中的类成员的属性中必须表括Synthectic属性

    attribute_name_index --

    attribute_length -- 0

  • 相关阅读:
    Kubernetes中部署MySQL
    内置函数-format()
    Jenkins-deploymnt
    一次遇到too many open files的解决详情
    一次nginx问题记录
    kickstart自动化安装系统
    Maven —— 命令行清除编译打包
    CURL 发送POST请求
    mysql的my.cnf配置参考
    利用nginx实现生产和灰度环境流量切换
  • 原文地址:https://www.cnblogs.com/zengyou/p/2556572.html
Copyright © 2011-2022 走看看