2019.10.22

JVM Specification的各种历史版本见Oracle的网站Java Language and Virtual Machine Specifications。可惜找不到第一版的,最找只能找到(看网站最下面的copyright是1999年的)The Java Virtual Machine Specification, Second Edition(只有HTML格式)。不知道为什么叫做JAVA SE6而不是JAVA SE2。

想看看JVM的手册是因为Chris Lattner学位论文里提到了JVM是高层次语言的虚拟机(LLVM正好相反,Low-Level Virtual Machine),

These VMs often target very dynamiclanguages, such as SmallTalk [21], Self [44], Java [22], and C# [32], and use a machine-independent byte-code input which encodes these languages at a very high-level (effectively at the AST level). By using a virtual machine and a very-high-level input program representation, these systems are able to provide platform portability and security services in addition to reasonable performance.

The Java Virtual Machine Specification, Second Edition阅读笔记

类型(Types)

参考3.2 Data Types3.3 Primitive Types and Values3.4 Reference Types and Values

Like the Java programming language, the Java virtual machine operates on two kinds of types: primitive types and reference types.

  • primitive types
    • numeric types
      • integral types
      • floating-point types
    • boolean type
    • returnAddress type
  • reference types
    • class types (references to dynamically created class instances)
    • array types
    • interface types

指令(Instructions)

参考3.11 Instruction Set Summary

A Java virtual machine instruction consists of a one-byte opcode specifying the operation to be performed, followed by zero or more operands supplying arguments or data that are used by the operation. Many instructions have no operands and consist only of an opcode.

我想这就是称其为byte code的原由了吧。


就只看看目录就应该知道JVM是个高层次语言的虚拟机了吧,

3.11.1 Types and the Java Virtual Machine

3.11.2 Load and Store Instructions

3.11.3 Arithmetic Instructions

3.11.4 Type Conversion Instructions

3.11.5 Object Creation and Manipulation

3.11.6 Operand Stack Management Instructions

3.11.7 Control Transfer Instructions

3.11.8 Method Invocation and Return Instructions

3.11.9 Throwing Exceptions

3.11.10 Implementing finally

3.11.11 Synchronization