- 浏览: 352358 次
- 性别:
- 来自: 南京
博客专栏
-
设计模式那些事儿
浏览量:5772
文章分类
- 全部博客 (85)
- news (3)
- java面试题 (3)
- java基础 (2)
- 英语短文 (2)
- 英语演讲 (2)
- Weekly Address (5)
- 英语写作 (2)
- 转载 (1)
- 2010 FIFA World Cup (5)
- Scrum (1)
- 计算机基础 (2)
- java引用对象 (1)
- 英语阅读 (1)
- Ext (6)
- Javascript (3)
- Web编程 (4)
- 战国策 (7)
- html (1)
- java (33)
- concurrency (1)
- jvm (31)
- 方法区 (9)
- 栈 (5)
- 堆 (1)
- 程序计数器 (1)
- 本地方法栈 (1)
- class file (5)
- 常量池 (2)
- attributes (1)
- 连接模型 (1)
- applet (1)
- gc (5)
- 垃圾收集 (5)
- 方法调用 (2)
- IBM (0)
- 门户(Portal) (0)
- Solr (1)
- Lucene (1)
- 全文检索 (1)
- 设计模式 (4)
- 责任链模式 (1)
- 责任链 (1)
- COR (1)
- Pattern (1)
最新评论
-
Nabulio:
是不错的
Java的Integer与int互转 -
shihengli2010:
学习了 !Integer i = 100; Integer ...
Java的Integer与int互转 -
flex涵:
还可以,差不多就是这个意思.
Java的Integer与int互转 -
lijingshou:
相当好用。。。
输入年月日格式yyyyMMdd,判断是否是周末 -
denverj:
你好,是这本书的英文版,名字叫<Inside the J ...
JVM学习笔记-帧数据区(Frame Data)
What is a Java Class File?
The Java class file is a precisely defined binary file format for Java programs. Each Java class file represents a complete description of one Java class or interface. There is no way to put more than one class or interface into a single class file. The precise definition of the class file format ensures that any Java class file can be loaded and correctly interpreted by any Java Virtual Machine, no matter what system produced the class file or what system hosts the virtual machine.
Java class文件是对Java程序二进制文件格式的精确定义。每一个Javaclass文件都对一个Java类或者Java接口做出了全面描述。一个class文件中只能包含一个类或者接口。无论Java class文件在何种系统上产生,无论虚拟机在何种系统上运行,对Java class文件的精确定义使得所有Java虚拟机都能够正确地读取和解释所有Javaclass文件。
Although the class file is related to the Java language architecturally, it is not inextricably linked to the Java language. As shown in Figure 6-1, you could write programs in other languages and compile them to class files, or you could compile your Java programs to a different binary file format. Nevertheless, most Java programmers will likely use the class file as the primary vehicle for delivering their programs to Java Virtual Machines.
尽管class文件与Java语言结构相关,但它并不一定必须与Java语言相关。如图6-1所示,可以使用其他语言来编写程序,然后将其编译为class文件,或者把Java程序编译为另一种不同的二进制文件格式。实际上,Javaclass文件的形式能够表示Java源代码中无法表达的有效程序,然而,绝大多数Java开发者几乎都会选择使用class文件作为程序传给虚拟机的首要方式。
As mentioned in earlier chapters, the Java class file is a binary stream of 8-bit bytes. Data items are stored sequentially in the class file with no padding between adjacent items. The lack of padding helps keep class files compact. Items that occupy more than one byte are split up into several consecutive bytes that appear in big-endian (higher bytes first) order.
如前所述,Java class文件是8位字节的二进制流。数据项按顺序存储在class文件中,相邻的项之间没有任何间隔,这样可以使class文件紧凑。占据多个字节空间的项按照高位在前的顺序分为几个连续的字节存放。
Just as your Java classes can contain varying numbers of fields, methods, method parameters, local variables, and so on, the Java class file can contain many items that vary in size or number from one class file to another. In the class file, the size or length of a variable-length item precedes the actual data for the item. This allows class file streams to be parsed from beginning to end, reading in the size of an item first followed by the item data.
和Java的类可以包含多个不同的字段,方法,方法参数,局部变量等一样,Java class文件也能够包含许多不同大小的项。在class文件中,可变长度项的大小和长度位于其实际数据之前。这个特性使得calss文件流可以从头到尾被顺序解析,首先读出项的大小,然后读出项的数据。
What's in a Class File?
The Java class file contains everything a Java Virtual Machine needs to know about one Java class or interface. The remainder of this chapter describes the class file format using tables. Each table has a name and shows an ordered list of items that can appear in a class file. Items appear in the table in the order in which they appear in the class file. Each item has a type, a name, and a count. The type is either a table name or one of the "primitive types" shown in Table 6-1. All values stored in items of type u2, u4, and u8 appear in the class file in big-endian order.
Java class文件中包含了Java虚拟机所知道的,关于类或者接口的所有信息。本章剩余部分将用表格形式描述class文件格式。每个表格都有一个名字,每个表格都显示了在class文件中出现的项的有序列表。这些项按照出现在class文件中的顺序在表中列出。每一项都包括类型、名称及该项的数量。类型或者未表名,或者为如表6-1所示的“基本类型”。所有存储在类型u2,u4和u8项中的值,在class文件中以高位在前的形式出现。
Table 6-1. Class file "primitive types"
u1 | a single unsigned byte |
u2 | two unsigned bytes |
u4 | four unsigned bytes |
u8 | eight unsigned bytes |
The major components of the class file, in their order of appearance in the class file, are shown in Table 6-2. Each of these components is described in more detail below.
可变长度的ClassFile表中的项,如表6-2所示,按照它们在class文件中出现的顺序列出了主要部分。
Table 6-2. Format of a ClassFile Table
Type | Name | Count | ||
u4 | magic | 1 | ||
u2 | minor_version | 1 | ||
u2 | major_version | 1 | ||
u2 | constant_pool_count | 1 | ||
cp_info | constant_pool | constant_pool_count - 1 | ||
u2 | access_flags | 1 | ||
u2 | this_class | 1 | ||
u2 | super_class | 1 | ||
u2 | interfaces_count | 1 | ||
u2 | interfaces | interfaces_count | ||
u2 | fields_count | 1 | ||
field_info | fields | fields_count | ||
u2 | methods_count | 1 | ||
method_info | methods | methods_count | ||
u2 | attributes_count | 1 | ||
attribute_info | attributes | attributes_count |
发表评论
-
java书籍
2011-12-15 15:31 0线程 Java Concurrency in Pra ... -
JVM学习笔记-本地方法调用(Invoking a Native Method)
2011-11-25 11:56 1157Invoking a Native Method ... -
JVM学习笔记-调用Java方法(Invoking a Java Method)
2011-11-25 11:35 1513Invoking a Java Method As m ... -
JVM学习笔记-分代收集器(Generational Collectors)
2011-11-23 14:41 1923Generational Collectors ... -
JVM学习笔记-拷贝收集器(Copying Collectors)
2011-11-22 16:34 1603Copying Collectors Copy ... -
JVM学习笔记-压缩收集器(Compacting Collectors)
2011-11-22 16:17 1324Compacting Collectors G ... -
JVM学习笔记-跟踪收集器(Tracing Collectors)
2011-11-22 16:04 1910Tracing Collectors Trac ... -
JVM学习笔记-引用计数收集器(Reference Counting Collectors)
2011-11-22 15:46 2490Reference Counting Collect ... -
applet notinited的解决方案
2011-11-13 14:45 4519最近项目当中正好使用到了applet,这个很少接触过的东东。 ... -
JVM学习笔记-动态连接和解析(Dynamic Linking and Resolution)
2011-11-08 11:09 3436When you compile a Java pro ... -
JVM学习笔记-属性格式(Attributes Types)
2011-11-07 12:15 1483Attributes The Java Vir ... -
JVM学习笔记-属性(Attributes)
2011-11-07 12:03 1514Attributes As mentioned ... -
JVM学习笔记-方法(Methods)
2011-11-07 11:25 2221Methods Each method dec ... -
JVM学习笔记-字段(Fields)
2011-11-07 11:17 1909Each field (class variable a ... -
JVM学习笔记-特殊字符串(Special Strings)
2011-11-05 14:33 1668Special Strings 特殊字符串 T ... -
JVM学习笔记-本地方法栈(Native Method Stacks)
2011-11-02 10:16 19183本地方法栈(Native Me ... -
JVM学习笔记-帧数据区(Frame Data)
2011-10-28 09:16 1720In addition to the local var ... -
JVM学习笔记-操作数栈(Operand Stack)
2011-10-27 11:12 14084Like the local variables, th ... -
JVM学习笔记-局部变量区(Local Variables)
2011-10-27 10:42 2993The local variables secti ... -
JVM学习笔记-栈帧(The Stack Frame)
2011-10-27 10:35 2518The stack frame has three pa ...
相关推荐
jvm 调优笔记-jvm
Moonbox(月光宝盒)是JVM-Sandbox生态下的,基于jvm-sandbox-repeater重新开发的一款流量回放平台产品。在jvm-sandbox-repeater基础上提供了更加丰富功能,同时便于线上部署和使用,更多对比参考。 使用场景 你...
nginx-upstream-jvm-route 支持nginx版本1.15 解决nginx: [emerg] invalid parameter "srun_id=tomcat1" 问题
JVM调优总结 -Xms -Xmx -Xmn -Xss
赠送Maven依赖信息文件:metrics-jvm-3.1.5.pom; 包含翻译后的API文档:metrics-jvm-3.1.5-javadoc-API文档-中文(简体)版.zip; Maven坐标:io.dropwizard.metrics:metrics-jvm:3.1.5; 标签:jvm、metrics、...
赠送Maven依赖信息文件:metrics-jvm-3.1.5.pom; 包含翻译后的API文档:metrics-jvm-3.1.5-javadoc-API文档-中文(简体)-英语-对照版.zip; Maven坐标:io.dropwizard.metrics:metrics-jvm:3.1.5; 标签:jvm、...
jvm-full-gc调优-jvm-full-gc
JVM性学习笔记-基本原理,内存模型,JVM参数设置,类加载器原理,JDK自带工具
011-第二章-class文件结构课程简介 012-class文件的理解 013-class文件的格式 014-大小端模式(1) 014-大小端模式 015-class文件的数据结构 016-class文件基本信息-魔数 017-class文件基本信息-魔数起源以及利用 018-...
nginx-upstream-jvm-route-0.1.tar.gz 用来实现Nginx Tomcat 集群session复制的问题!
mini-jvm in rust实现jvm,jvm-rs-main.zip
代码如下:failed to create jvm error code -4 这一般应是内存不够用所致,解决方法参考如下。 打开 Android Studio 安装目录下的bin目录,查找并打开文件 studio.exe.vmoptions,修改代码: 代码如下:-Xmx512m 为...
Classfile /home/chris/Code/jvm-class-file-parser/classes/Dummy.class Compiled from: "Dummy.java" class Dummy minor version: 0 major version: 52 flags: ACC_PUBLIC, ACC_SUPER Constant pool: #1 = ...
JVM调优总结 -Xms -Xmx -Xmn -Xss JVM调优总结 -Xms -Xmx -Xmn -Xss
nginx_upstream_jvm_route 是一个 Nginx 的扩展模块,用来实现基于 Cookie 的 Session Sticky 的功能。 安装方法(进入Nginx源码目录): #patch -p0 < /path/to/this/directory/jvm_route.patch # ./configure -...
JVM,MIB,可通过SNMP协议监控JVM运行情况
一份JVM学习的笔记,含查看JVM运行时信息\JVM垃圾收集信息\JVM锁信息等
jvm性能调优-jvm内存模型和优化-performance-jvm-memorymodel-optimize
JVM规范--高手总结 Java相关 1 1.1Java定义 1 1.2Java的开发流程 1 1.3Java运行的原理 2 1.4半编译半解释 3 1.5平台无关性 4 JVM内存模型 4 2.1 JVM规范 5 2.2 Sun JVM 8 2.3 SUN JVM内存管理(优化) 10 2.4 SUN JVM...
Java分布式应用学习笔记-谈JVM