zoukankan      html  css  js  c++  java
  • JVM学习笔记【1】

    Java Class文件

          属性在Java Class文件中多处出现,可以再ClassFile、field_info、method_info和Code_attribute表中。Java虚拟机规范定义了9种属性,为了能正确地解释Java class文件,所有Java虚拟机都必须能够三种属性:CodeConstantValueException。为了 能正确地实现Java和Java 2平台类库,虚拟机实现必须能够识别InnerClassersSynthetic属性。有规范定义的attribute_info表的类型如下:

    名称 使用者 描述
    Code method_info 方法的字节码和其他数据
    ConstantValue field_info final变量的值
    Deprecated field_info/method_info 字段或者方法被禁用的指示符
    Exceptions method_info 方法可能抛出的可能检测的异常
    InnerClasses ClassFile 内部、外部类的列表
    LineNumberTable Code_attribute 方法的行号与字节码的映射
    LocalVariableTable Code_attribute 方法的局部变量的描述
    SourceFile ClassFile 源文件名
    Syntheric field_info/method_info 编译器长身的字段或者方法的指示符

           attribute_info的构成为:attribute_name_index【2】+attribute_length【4】+info【attribute_length】。其中attribute_name_index给出了包含属性名称的CONSTANT_Utf8入口的常量池。 各个属性的结构如下(这里只给出info部分):

    1. Code:max_stack【2]+max_locals[2】+code_length【4】+code【code_length】+exception_table_length【2】+exception_table【exception_table_length】+attributes_count【2】+attributes【attributes_count】:max_stack是操作数栈的最大长度,max_locals是局部变量所需空间,code_length是字节码流的长度,exception_table是一贯exception_info表的列表,表示捕获异常的顺序,attributes是sttribute_info表的列表。
  • 相关阅读:
    css 实现换肤几种方式
    vue 使用中的小技巧 (一)
    GitLab集成Jenkins、Harborn构建pipeline流水线任务
    GitLab数据迁移
    Jenkins更换国内插件源以及Jenkins更新(Jenkins部署在Docker中)
    docker-compose安装JenKins
    docker-compose安装Nexus
    docker-compose安装GitLab
    安装Harbor并修改默认使用的80端口
    在CentOS7.5中基于docker-compose安装mysql5.7
  • 原文地址:https://www.cnblogs.com/ggzwtj/p/2393390.html
Copyright © 2011-2022 走看看