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表的列表。
  • 相关阅读:
    Go语言操作etcd
    grafana使用
    Java整理
    Go操作MySQL
    Go语言操作Redis
    es
    influxDB
    gopsutil
    Java基础之(三):IDEA的安装及破解 lyl
    ClojureScript 点访问格式
  • 原文地址:https://www.cnblogs.com/ggzwtj/p/2393390.html
Copyright © 2011-2022 走看看