The Java Virtual Machine Specification, Java SE 7 Edition cover

The Java Virtual Machine Specification, Java SE 7 Edition

No rating yet
Series
Java Core Technology Series
ISBN
9787111445159

Tags

Summary

This book is the Chinese translation of Oracle's official The Java Virtual Machine Specification, Java SE 7 Edition, and is part of the Java Core Technology Series. It consolidates the technical changes that have taken place in the Java world since the 1999 publication of The Java Virtual Machine Specification, Second Edition, corrects numerous errors in the second edition as well as content that has become obsolete for mainstream virtual machine implementations, and clarifies some ambiguous concepts concerning the relationship between the Java virtual machine and the Java language. The book comprises 7 chapters: Chapter 1 surveys, from a high-level perspective, the relationship between the Java virtual machine and the Java language and their development; Chapter 2 outlines the overall architecture of the virtual machine, including the class file format, data types, primitive and reference types, run-time data areas (the pc register, Java virtual machine stack, heap, method area, run-time constant pool, and native method stack), frames, object representation, floating-point arithmetic, and exceptions; Chapter 3 explains how Java programs are compiled into the virtual machine instruction set, covering constants, local variables, control structures, arithmetic operations, argument passing, method invocation, arrays, the operand stack, exception handling, synchronization, and annotations; Chapter 4 analyzes the class file format in depth, including the ClassFile structure, descriptors and signatures, the constant pool, fields, methods, attributes, code constraints, and class file verification; Chapter 5 defines virtual machine startup and the loading, linking, and initialization of classes and interfaces; Chapter 6 specifies the instruction set item by item; and Chapter 7 provides a table of opcode mnemonics indexed by opcode value. It should be noted that this book is a contractual specification ensuring that all Java virtual machine implementations share a uniform external interface; it is not an implementation manual for any particular virtual machine. As high-performance virtual machines have evolved, the details of real implementations have gradually diverged from the specification's descriptions.

Editor's review

如果你写过不少 Java 代码,却总在「为什么这里会抛 StackOverflowError」「泛型擦除到底擦掉了什么」「字节码里的 invokespecial 和 invokevirtual 差在哪」这类问题上卡壳,那么这本规范就是最该补齐的那块地基。它不是教程,而是 Oracle 官方发布的技术契约:每一种数据类型、每一个运行时数据区、每一个属性表、每一条指令的语义,都以近乎法律条文的方式被精确定义。 本版的价值在于「承前启后」。它把自 1999 年第 2 版以来的十余年变化一次性收拢,扩充 class 文件格式以支持泛型与变长参数方法等新语言特性,补充了 invokedynamic 等新常量池结构,同时清理了旧版中大量错误与过时描述,并重写了基于类型检查的字节码验证规则——这部分正是理解现代 JVM 类校验机制的关键。 中文版由周志明等四位译者合作完成,译文经过多轮校对,术语体系与国内 JVM 社区通行说法一致;32 开、三百余页的体量,作为案头工具书翻查并不吃力。无论你是想读懂 class 文件反编译结果,还是准备动手写一个玩具虚拟机,它都会是你反复回来查阅的那一本。

Who it's for

A good fit for

  • 已掌握 Java 语法、想深入理解 JVM 底层机制的中高级开发者
  • 需要阅读或解析 class 文件、编写字节码工具链的工程师
  • 正在实现或改造虚拟机、解释器、编译器的研发人员
  • 准备 JVM 相关技术面试、希望建立系统知识框架的求职者

Not a good fit for

  • 零基础或刚学 Java 语法的入门读者,本书几乎不教编程方法
  • 只想学 Spring、并发等应用框架实战、不关心底层的开发者
  • 期待读到 HotSpot 等具体虚拟机调优与参数实践的人

Reading tips

  1. 先通读第 1、2 章建立整体架构图,再按需查阅第 4、6 章细节,不必从头线性啃完。
  2. 配合 javap -v 反编译自己写的类,对照第 4 章逐项核对常量池与属性表,效果最佳。
  3. 阅读第 2、3 章前补一点计算机体系结构基础,理解栈帧、寄存器与方法调用会更顺畅。
  4. 把它当工具书而非小说,遇到字节码或类加载疑问时定点查阅,并配合具体虚拟机实现源码验证。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

FAQ

这本书和《深入理解Java虚拟机》有什么区别?
本书是 Oracle 官方规范的译本,定义「虚拟机应该是什么样」,偏标准与契约;《深入理解Java虚拟机》是周志明撰写的讲解型著作,介绍实现原理与调优实践。两者互补,规范适合查阅,讲解书适合入门通读。
Java SE 7 版现在看会不会过时?
核心内容如 class 文件结构、运行时数据区、类加载与指令集语义基本稳定,仍是理解 JVM 的可靠基础。后续版本新增的模块化、record 等特性需再读新版规范补充。
读这本书需要哪些前置知识?
至少熟悉 Java 语法与面向对象,了解基本数据类型、异常和泛型;此外建议具备汇编或计算机组成原理的初步概念,否则栈帧和指令集部分会较吃力。
为什么书里的内容和 HotSpot 实际实现不完全一致?
规范只约束对外可见的行为与接口,不规定内部实现。高性能虚拟机在对象布局、即时编译等方面已与规范描述拉开差距,属正常现象。
中文版翻译质量如何?
由周志明、薛笛、吴璞渊、冶秀刚合作翻译,经机械工业出版社正式出版,术语与国内 JVM 社区通行说法基本一致,可放心阅读原文规范对照使用。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

Top rated in the same category