Spec_Java Virtual Machine

  1. Introduction
  2. The Structure of the Java Virtual Machine
  3. Compiling for the Java Virtual Machine
  4. The class File Format
  5. Loading, Linking, and Initializing
  6. The Java Virtual Machine Instruction Set
  7. 总结

img

Introduction

JSR-000924 JavaTM Virtual Machine Specification
(Close of Maintenance Review: 19 July 2004)

Memory Model (Chapter 8) - JSR 133 has changed the memory model. Chapter 8 of the Java Virtual Machine Specification, Second Edition is superseded by JSR 133. See chapter 17 of the Java Language Specification, Third Edition for details.

Java SE 7 开始内存模型被移除,相关规范在java语言规范第17章

Java 虚拟机与 Java 语言并没有必然的联系,它只与特定的二进制文件格式——Class 文件
格式所关联,Class 文件中包含了 Java 虚拟机指令集(或者称为字节码、Bytecodes)和符号
表,还有一些其他辅助信息。

基于安全方面的考虑,Java 虚拟机要求在 Class 文件中使用了许多强制性的语法和结构化
约束,但任一门功能性语言都可以表示为一个能被 Java 虚拟机接收的有效的 Class 文件。

作为一个通用的、机器无关的执行平台,任何其他语言的实现者都可以将 Java 虚拟机作为他们语言的
产品交付媒介。

Summary of Chapters

The rest of this book is structured as follows:

  • Chapter 2 gives an overview of the Java Virtual Machine architecture.

    Java 虚拟机结构

  • Chapter 3 introduces compilation of code written in the Java programming language into the instruction set of the Java Virtual Machine.

  • Chapter 4 specifies the class file format, the hardware- and operating system- independent binary format used to represent compiled classes and interfaces.

  • Chapter 5 specifies the start-up of the Java Virtual Machine and the loading, linking, and initialization of classes and interfaces.

  • Chapter 6 specifies the instruction set of the Java Virtual Machine, presenting the instructions in alphabetical order of opcode mnemonics.

  • Chapter 7 gives a table of Java Virtual Machine opcode mnemonics indexed by opcode value.

The Structure of the Java Virtual Machine

运行时内存结构 、相关的包、 帧

Compiling for the Java Virtual Machine

将java文件编译成字节码,

Double和Long 的占据两个位置

synchronized 会加入monitorenter monitorexit

异常表

The class File Format

类文件结构

Loading, Linking, and Initializing

类加载

The Java Virtual Machine Instruction Set

字节码指令集

总结

虚拟机规范 并不包含如下

  • Adaptive compiler: A standard interpreter is used to launch the applications. When the application runs, the code is analyzed to detect performance bottlenecks, or hot spots. The Java HotSpot VM compiles the performance-critical portions of the code for a boost in performance, but does not compile the seldom-used code (most of the application). The Java HotSpot VM uses the adaptive compiler to decide how to optimize compiled code with techniques such as inlining.
  • Rapid memory allocation and garbage collection: Java HotSpot technology provides rapid memory allocation for objects and fast, efficient, state-of-the-art garbage collectors.
  • Thread synchronization: Java HotSpot technology provides a thread-handling capability that is designed to scale for use in large, shared-memory multiprocessor servers.

HotSpot实现

中文资料

JDK1.7中的介绍

jvm相关推荐一个大佬


转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 951488791@qq.com

文章标题:Spec_Java Virtual Machine

字数:629

本文作者:zhengyumin

发布时间:2019-06-13, 17:25:17

最后更新:2020-04-09, 12:02:03

原始链接:http://zyumin.github.io/2019/06/13/Spec-Java-Virtual-Machine/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。