JVM学习笔记-类型信息(Type Information)
?
For each type it loads, a Java Virtual Machine must store the following kinds of information in the method area:
?对每个装载的类型,虚拟机都会在方法区中存储以下类型信息:
The fully qualified name of the typeInside the Java class file and Java Virtual Machine, type names are always stored as fully qualified names. In Java source code, a fully qualified name is the name of a typeís package, plus a dot, plus the typeís simple name. For example, the fully qualified name of class Object in package java.lang is java.lang.Object. In class files, the dots are replaced by slashes, as in java/lang/Object. In the method area, fully qualified names can be represented in whatever form and data structures a designer chooses.
在Java class文件和虚拟机中,类型名总是以全限定名出现。在Java源代码中,全限定名由类所属包的名称加一个“.”,再加上类名组成。例如,类Object的所属包为java.lang,那么它的全限定名应该是java.lang.Object,但在class文件里,所有的“.” 都被斜杠“/”代替,这样就成为java/lang/Object。至于全限定名在方法区中的表示,则因不同的设计者有不同的选择而不同,可以用任何形式和数据结构来表示。
In addition to the basic type information listed above, the virtual machine must also store for each loaded type:
除了上面列出的基本类型信息外,虚拟机还得为每个被装载的类型存储以下信息:
The constant pool for the type