The virtual machine concept represents a platform-independent set of computer instructions for compiling Java programs for multiple platforms. This abstract component of the Java language provides the mechanisms for exploiting portability, efficiency and reliability. This text, aimed at developers responsible for performance tuning, security, reliability and other system-level programming issues, presents detailed machine-independent information, which provides readers with sufficient details to implement the abstract design in a range of technologies. Readers are guided through elements of the abstract machine design as well as strategies for creating concrete interchange formats for compiled Java code.
Table of Contents:
Preface.
1. Introduction.
2. Java Concepts.
Unicode.
Identifiers.
Literals.
Types and Values.
Variables.
Conversions and Promotions.
Names and Packages.
Classes.
Fields.
Methods.
Static Initializers.
Constructors.
Interfaces.
Arrays.
Exceptions.
Execution.
Threads.
3. Structure of the Java Virtual Machine
Data Types.
Primitive Types and Values.
Reference Types and Values.
Words.
Runtime Data Areas.
Frames.
Representation of Objects.
Special Initialization Methods.
Exceptions.
The class File Format.
Instruction Set Summary.
Public Design, Private Implementation.
4. The class File Format.
ClassFile.
Internal Form of Fully Qualified Class Names.
Descriptors.
Constant Pool.
Fields.
Methods.
Attributes.
Constraints on Java Virtual Machine Code.
Verification of class Files.
Limitations of the Java Virtual Machine and class File Format.
5. Constant Pool Resolution.
Class and Interface Resolution.
Field and Method Resolution.
Interface Method Resolution.
String Resolution.
Resolution of Other Constant Pool Items.
6. Java Virtual Machine Instruction Set.
Assumptions: The Meaning of "Must".
Reserved Opcodes.
Virtual Machine Errors.
The Java Virtual Machine Instruction Set.
7. Compiling for the Java Virtual Machine.
Format of Examples.
Use of Constants, Local Variables, and Control Constructs.
Arithmetic.
Accessing the Constant Pool.
More Control Examples.
Receiving Arguments.
Invoking Methods.
Working with Class Instances.
Arrays.
Compiling Switches.
Operations on the Operand Stack.
Throwing and Handling Exceptions.
Compiling finally.
Synchronization.
8. Threads and Locks.
Terminology and Framework.
Execution Order and Consistency.
Rules About Variables.
Nonatomic Treatment of Double and Long Variables.
Rules About Locks.
Rules About the Interaction of Locks and Variables.
Rules for Volatile Variables.
Prescient Store Operations.
Discussion.
Example: Possible Swap.
Example: Out-of-Order Writes.
Threads.
Locks and Synchronization.
Wait Sets and Notification.
9. An Optimization.
Dynamic Linking via Rewriting.
The _quick Pseudo-instructions.
10. Opcode Mnemonics by Opcode.
Index. 020163452XT04062001