JVM Tutorials - Herong's Tutorial Examples
∟JVM (Java Virtual Machine) Specification
∟What Is JVM Specfication
This section describes what is JVM Specfication.
What Is JVM Specfication?
The JVM specification is a list of detailed requirements for JVM implementations.
The current version of JVM specification is
"The Java® Virtual Machine Specification - Java SE 14 Edition",
written by Tim Lindholm, Frank Yellin, Gilad Bracha, Alex Buckley, and Daniel Smith.
You can download a PDF copy at
https://docs.oracle.com/javase/specs/.
The JVM specification covers the following areas:
- The class File Format -
Sepcifies the JVM class file format, which is used to define
a single class, interface, or module, in bytecode.
- Data Types -
Specifies a list of data types (divided into two groups: primitive types and reference types)
supported in the JVM.
- Primitive Types and Values -
Specifies a list of primitive types (divided into three sub-groups:
numeric types, the boolean type, and the returnAddress type).
It also specifies what data values are supported for each primitive type.
- Reference Types and Values -
Specifies three kinds of reference types: class types, array types, and interface
types. Their values are references to dynamically created class instances, arrays,
and class instances (or arrays that implement interfaces) respectively.
- Run-Time Data Areas -
Specifies six types of data areas to be used during the execution of a program:
The pc Register, JVM Stacks, Heap, Method Area, Run-Time Constant Pool, and Native Method Stacks.
- Frames -
Specifies how frames are used to support method calls.
A frame is created each time a method is called and destroyed when
the call is completed.
The frame of each method call is used to store data and partial results,
as well as to perform dynamic linking, return values for methods, and dispatch exceptions.
- Representation of Objects -
No specification is provided on how objects are represented in memory.
Implementations can make their own decisions.
- Floating-Point Arithmetic -
Specifies that JVM should use a subset of the floating-point arithmetic
specified in IEEE Standard for Binary Floating-Point Arithmetic.
- Special Methods -
Specifies 3 special methods used in classes:
Instance Initialization Methods, Class Initialization Methods, and Signature Polymorphic Methods.
- Exceptions -
Specifies how an execution exception should be represented and how it should be processed.
- Instruction Set -
Specifies the JVM instruction set.
A single 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.
- Class Libraries -
Specifies that JVM must provide support classes in standard class libraries
that interact with the JVM. Examples are:
java.lang.Class, java.lang.ClassLoader, java.lang.reflect.*,
java.lang.SecurityManager, java.security.*, java.lang.Thread,
and java.lang.ref.*.
Table of Contents
About This Book
►JVM (Java Virtual Machine) Specification
What Is JVM (Java Virtual Machine)
►What Is JVM Specfication
JVM Architectures and Components
Implementations of JVM Specfication
Java HotSpot VM - JVM by Oracle/Sun
java.lang.Runtime Class - The JVM Instance
java.lang.System Class - The Operating System
ClassLoader Class - Class Loaders
Class Class - Class Reflections
JVM Runtime Data Areas
JVM Stack, Frame and Stack Overflow
Thread Testing Program and Result
CPU Impact of Multi-Thread Applications
I/O Impact of Multi-Thread Applications
CDS (Class Data Sharing)
Micro Benchmark Runner and JVM Options
Micro Benchmark Tests on "int" Operations
Micro Benchmark Tests on "long" Operations
Micro Benchmark Tests in JIT Compilation Mode
Micro Benchmark Tests on "float" and "double" Operations
OpenJ9 by Eclipse Foundation
JRockit JVM 28.2.7 by Oracle Corporation
Outdated Tutorials
References
Full Version in PDF/EPUB