前言
1 Introduction
1.1 A Bit of History
1.2 The Java Virtual Machine
1.3 Organization of the Specification
1.4 Notation
1.5 Feedback
2 The Structure of the Java Virtual Machine
2.1 The class File Format
2.2 Data Types
2.3 Primitive Types and Values
2.3.1 Integral Types and Values
2.3.2 Floating-Point Types, Value Sets, and Values
2.3.3 The returnAddress Type and Values
2.3.4 The boolean Type
2.4 Reference Types and Values
2.5 Run-Time Data Areas
2.5.1 The pc Register
2.5.2 Java Virtual Machine Stacks
2.5.3 Heap
2.5.4 Method Area
2.5.5 Run-Time Constant Pool
2.5.6 Native Method Stacks
2.6 Frames
2.6.1 Local Variables
2.6.2 Operand Stacks
2.6.3 Dynamic Linking
2.6.4 Normal Method Invocation Completion
2.6.5 Abrupt Method Invocation Completion
2.7 Representation of Objects
2.8 Floating-Point Arithmetic
2.8.1 Java Virtual Machine Floating-Point Arithmetic and IEEE 754
2.8.2 Floating-Point Modes
2.8.3 Value Set Conversion
2.9 Special Methods
2.10 Exceptions
2.11 Instruction Set Summary
2.11.1 Types and the Java Virtual Machine
2.11.2 Load and Store Instructions
2.11.3 Arithmetic Instructions
2.11.4 Type Conversion Instructions
2.11.5 Object Creation and Manipulation
2.11.6 Operand Stack Management Instructions
2.11.7 Control Transfer Instructions
2.11.8 Method Invocation and Return Instructions
2.11.9 Throwing Exceptions
2.11.10 Synchronization
2.12 Class Libraries
2.13 Public Design, Private Implementation
3 Compiling for the Java Virtual Machine
3.1 Format of Examples
3.2 Use of Constants, Local Variables, and Control Constructs
3.3 Arithmetic
3.4 Accessing the Run-Time Constant Pool
3.5 More Control Examples
3.6 Receiving Arguments
3.7 Invoking Methods
3.8 Working with Class Instances
3.9 Arrays
3.10 Compiling Switches
3.11 Operations on the Operand Stack
3.12 Throwing and Handling Exceptions
3.13 Compiling finally
3.14 Synchronization
3.15 Annotations
4 The class File Format
4.1 The ClassFile Structure
4.2 The Internal Form of Names
4.2.1 Binary Class and Interface Names
4.2.2 Unqualified Names
4.3 Descriptors
4.3.1 Grammar Notation
4.3.2 Field Descriptors
4.3.3 Method Descriptors
4.4 The Constant Pool
4.4.1 The CONSTANT_Class_info Structure
4.4.2 The CONSTANT_Fieldref_info, CONSTANT_Methodref_info, and CONSTANT_InterfaceMethodref_info Structures
4.4.3 The CONSTANT_String_info Structure
4.4.4 The CONSTANT_Integer_info and CONSTANT_Float_info Structures
4.4.5 The CONSTANT_Long_info and CONSTANT_Double_info Structures
4.4.6 The CONSTANT_NameAndType_info Structure
4.4.7 The CONSTANT_Utf8_info Structure
4.4.8 The CONSTANT_MethodHandle_info Structure
4.4.9 The CONSTANT_MethodType_info Structure
4.4.10 The CONSTANT_InvokeDynamic_info Structure
4.5 Fields
4.6 Methods
4.7 Attributes
4.7.1 Defining and Naming New Attributes
4.7.2 The ConstantValue Attribute
4.7.3 The Code Attribute
4.7.4 The StackMapTable Attribute
4.7.5 The Exceptions Attribute
4.7.6 The InnerClasses Attribute
4.7.7 The EnclosingMethod Attribute
4.7.8 The Synthetic Attribute
4.7.9 The Signature Attribute
4.7.9.1 Signatures
4.7.10 The SourceFile Attribute
4.7.11 The SourceDebugExtension Attribute
4.7.12 The LineNumberTable Attribute
4.7.13 The LocalVariableTable Attribute
4.7.14 The LocalVariableTypeTable Attribute
4.7.15 The Deprecated Attribute
4.7.16 The RuntimeVisibleAnnotations Attribute
4.7.16.1 The element_value structure
4.7.17 The RuntimeInvisibleAnnotations Attribute
4.7.18 The RuntimeVisibleParameterAnnotations Attribute
4.7.19 The RuntimeInvisibleParameterAnnotations Attribute
4.7.20 The RuntimeVisibleTypeAnnotations Attribute
4.7.20.1 The target_info union
4.7.20.2 The type_path structure
4.7.21 The RuntimeInvisibleTypeAnnotations Attribute
4.7.22 The AnnotationDefault Attribute
4.7.23 The BootstrapMethods Attribute
4.7.24 The MethodParameters Attribute
4.8 Format Checking
4.9 Constraints on Java Virtual Machine Code
4.9.1 Static Constraints
4.9.2 Structural Constraints
4.10 Verification of class Files
4.10.1 Verification by Type Checking
4.10.1.1 Accessors for Java Virtual Machine Artifacts
4.10.1.2 Verification Type System
4.10.1.3 Instruction Representation
4.10.1.4 Stack Map Frame Representation
4.10.1.5 Type Checking Abstract and Native Methods
4.10.1.6 Type Checking Methods with Code
4.10.1.7 Type Checking Load and Store Instructions
4.10.1.8 Type Checking for protected Members
4.10.1.9 Type Checking Instructions
4.10.2 Verification by Type Inference
4.10.2.1 The Process of Verification by Type Inference
4.10.2.2 The Bytecode Verifier
4.10.2.3 Values of Types long and double
4.10.2.4 Instance Initialization Methods and Newly Created Objects
4.10.2.5 Exceptions and finally
4.11 Limitations of the Java Virtual Machine
5 Loading, Linking, and Initializing
5.1 The Run-Time Constant Pool
5.2 Java Virtual Machine Startup
5.3 Creation and Loading
5.3.1 Loading Using the Bootstrap Class Loader
5.3.2 Loading Using a User-defined Class Loader
5.3.3 Creating Array Classes
5.3.4 Loading Constraints
5.3.5 Deriving a Class from a class File Representation
5.4 Linking
5.4.1 Verification
5.4.2 Preparation
5.4.3 Resolution
5.4.3.1 Class and Interface Resolution
5.4.3.2 Field Resolution
5.4.3.3 Method Resolution
5.4.3.4 Interface Method Resolution
5.4.3.5 Method Type and Method Handle Resolution
5.4.3.6 Call Site Specifier Resolution
5.4.4 Access Control
5.4.5 Overriding
5.5 Initialization
5.6 Binding Native Method Implementations
5.7 Java Virtual Machine Exit
6 The Java Virtual Machine Instruction Set
6.1 Assumptions: The Meaning of "Must"
6.2 Reserved Opcodes
6.3 Virtual Machine Errors
6.4 Format of Instruction Descriptions
mnemonic
6.5 Instructions
aaload
aastore
aconst_null
aload
aload_<n>
anewarray
areturn
arraylength
astore
astore_<n>
athrow
baload
bastore
bipush
caload
castore
checkcast
d2f
d2i
d2l
dadd
daload
dastore
dcmp<op>
dconst_<d>
ddiv
dload
dload_<n>
dmul
dneg
drem
dreturn
dstore
dstore_<n>
dsub
dup
dup_x1
dup_x2
dup2
dup2_x1
dup2_x2
f2d
f2i
f2l
fadd
faload
fastore
fcmp<op>
fconst_<f>
fdiv
fload
fload_<n>
fmul
fneg
frem
freturn
fstore
fstore_<n>
fsub
getfield
getstatic
goto
goto_w
i2b
i2c
i2d
i2f
i2l
i2s
iadd
iaload
iand
iastore
iconst_<i>
idiv
if_acmp<cond>
if_icmp<cond>
if<cond>
ifnonnull
ifnull
iinc
iload
iload_<n>
imul
ineg
instanceof
invokedynamic
invokeinterface
invokespecial
invokestatic
invokevirtual
ior
irem
ireturn
ishl
ishr
istore
istore_<n>
isub
iushr
ixor
jsr
jsr_w
l2d
l2f
l2i
ladd
laload
land
lastore
lcmp
lconst_<l>
ldc
ldc_w
ldc2_w
ldiv
lload
lload_<n>
lmul
lneg
lookupswitch
lor
lrem
lreturn
lshl
lshr
lstore
lstore_<n>
lsub
lushr
lxor
monitorenter
monitorexit
multianewarray
new
newarray
nop
pop
pop2
putfield
putstatic
ret
return
saload
sastore
sipush
swap
tableswitch
wide
7 Opcode Mnemonics by Opcode
Index
A Limited License Grant
这是一本挑战极限的书。我之前认为自己对Java已经相当熟悉了,但《Java虚拟机规范(Java SE 8版 英文版)》像是一盆冷水,让我意识到还有如此广阔且未知的领域等着我去探索。我一直对Java的性能调优感到头疼,尤其是在处理大型、高并发的系统时。这本书中关于性能优化的章节,虽然没有直接给出“如何调优”的具体步骤,但它深入剖析了JVM的各项性能指标,比如执行引擎的工作方式、即时编译(JIT)的优化策略、以及各种内存区域的回收机制。理解这些原理,让我能够从根本上理解为什么某些代码会慢,为什么会出现内存泄漏,以及如何通过调整JVM参数来获得更好的表现。书中关于类文件格式的解析也相当细致,了解了Class文件的结构,包括魔数、版本信息、常量池、字段、方法等,这对于编写或者理解一些底层的Java工具,比如字节码增强工具(ASM, Javassist)非常有帮助。这本书需要很强的英语阅读能力和对计算机科学的基础理论有较好的掌握,但一旦克服了这些门槛,你将获得前所未有的洞察力。它不是那种可以让你“速成”的书,而是需要你沉下心来,一点点去啃,去理解,去消化。
评分我必须承认,在翻开这本《Java虚拟机规范(Java SE 8版 英文版)》之前,我对JVM的认识还停留在“会用就好”的层面。然而,这本书彻底改变了我的看法。它以一种近乎“黑箱”到“透明”的转变,让我看到了JVM背后是如何工作的。对我而言,最令我着迷的是其中关于字节码指令集的详细描述。理解这些底层的指令,就好像拥有了破解Java代码执行秘密的钥匙。书中不仅列出了各种指令,还解释了它们的功能、参数以及在虚拟机栈上的操作,这对于我调试一些非常底层的问题,或者尝试编写更高效的JVM工具类非常有启发。同时,我对并发模型部分的讲解也深有体会。Java内存模型(JMM)的各种规则,happens-before关系,以及volatile、synchronized关键字的真正含义,都在书中得到了严谨的定义。这让我明白了为什么在多线程环境下会出现各种看似不可思议的现象,以及如何通过遵循规范来编写健壮的并发程序。这本书的语言虽然专业,但逻辑清晰,结构完整,每当我遇到某个不解的Java行为时,都能在这本书中找到答案的线索。它不仅仅是一本技术手册,更是一种对Java语言底层设计哲学和工程智慧的深刻解读。
评分对于任何一个想要深入理解Java的人来说,《Java虚拟机规范(Java SE 8版 英文版)》都是一本不可或缺的参考书。我特别欣赏它对Java语言的抽象模型和JVM实现的精确描述。这本书不是教你如何写Java代码,而是教你Java代码是如何被运行的。我喜欢它对异常处理机制的细致说明,以及Java栈帧(Stack Frame)的组成和生命周期。理解栈帧,对于理解方法调用、局部变量表、操作数栈以及动态链接等概念至关重要。而且,书中关于线程模型和同步机制的阐述,为我解答了许多在并发编程中遇到的困惑。它清晰地定义了Java内存模型(JMM)中各个内存操作的语义,以及happens-before关系的规则,这对于避免数据竞争和线程安全问题提供了坚实的基础。虽然这本书的语言相对严谨和技术化,但其逻辑非常严密,层层递进,能够帮助读者建立起一个完整的JVM知识体系。我常常在遇到一些Java行为的“怪癖”时,会回到这本书中查找相关的解释,并且每次都能获得新的启发。它就像是一本底层的“操作手册”,让Java在你眼中不再是神秘的黑盒。
评分这本《Java虚拟机规范(Java SE 8版 英文版)》绝对是我近几年来最令人振奋的阅读体验之一。作为一个长期在Java生态中摸爬滚打的开发者,我一直渴望能深入理解Java虚拟机(JVM)的底层运作机制,而这本书无疑是金字塔尖的宝藏。它以一种极其严谨且系统的方式,为我描绘了JVM的蓝图。我尤其喜欢它对内存模型的详细阐述,从堆、栈到方法区,每一个区域的职责、生命周期以及它们之间的交互都解释得淋漓尽致。书中对垃圾回收算法的剖析更是让我茅塞顿开,我终于能理解不同回收器(如Serial, Parallel, CMS, G1)的原理、适用场景以及它们的权衡之处。过去,我常常因为一些难以捉摸的性能问题而头疼,但现在,通过这本书的指导,我能够更有针对性地去分析和优化,这对于提升应用程序的稳定性和效率至关重要。而且,它对类加载机制的深入讲解,从加载、验证、准备、解析到初始化的每一个阶段都做了清晰的界定,这对于理解Java的动态性、多态性以及避免一些常见的类加载问题非常有帮助。这本书并非易读之物,需要相当的耐心和基础知识,但一旦你投入进去,所收获的洞察力是无价的。它就像是一张详尽的地图,指引着我们穿越Java语言的表象,直达其核心的运行机制。
评分作为一名资深的Java开发者,我一直在寻找一本能够真正解答我关于JVM“为什么”的书,而《Java虚拟机规范(Java SE 8版 英文版)》恰好满足了我的需求。我尤其对其中关于执行引擎(Execution Engine)部分的描述印象深刻,它详细阐述了Java虚拟机如何解释执行字节码,以及即时编译(JIT)技术如何通过将热点代码编译成本地机器码来提升性能。理解JIT的原理,让我对Java的“一次编写,到处运行”的跨平台特性有了更深刻的认识,也明白了为什么Java在启动时可能相对较慢,但一旦“预热”完成,性能就能大幅提升。书中对类加载过程的详尽描述,包括双亲委派模型(Parent Delegation Model),对于理解Java的类加载机制、避免类加载冲突、以及实现自定义类加载器都有着重要的指导意义。这本书的语言虽然精炼,但内容极其丰富,它以一种非常严谨和规范的方式,为读者展现了JVM的内在世界。它不是一本可以轻松翻阅的书籍,需要投入大量的时间和精力去理解其中的概念和原理,但其带来的回报是巨大的,能够极大地提升开发者对Java语言的掌控力,并帮助他们在实际开发中做出更明智的决策。
评分拿到书的时候,书本身已经不重要了,小哥敬业的态度,值得我们学习
评分堪称技术类世界名著,有空时看上一篇,慢慢看
评分质量很好,包装很新
评分书是好书,正在看呢……学到了不少东西。只是书寄来的时候边角都坏了……
评分书不错,是正版
评分拿到书的时候,书本身已经不重要了,小哥敬业的态度,值得我们学习
评分早就想看了,这次顺带先买了,有空再看吧
评分堪称技术类世界名著,有空时看上一篇,慢慢看
评分包装很好,提升Java编程效率很有帮助。
本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度,google,bing,sogou 等
© 2025 book.coffeedeals.club All Rights Reserved. 静流书站 版权所有