Overview
The nucleus of the Java(TM) 2 platform, the Java(TM) virtual machine is the technology that enables the Java 2 platform to host applications on any computer or operating system without rewriting or recompiling. The Java virtual machine is also responsible for the compactness of applications targeting the Java 2 platform, and is the basis for its security capabilities.
This book was written by those directly responsible for the design and implementation of the Java virtual machine, and is the complete and definitive specification for the technology. It is an essential reference for writers of compilers for the Java programming language and implementors of the Java virtual machine. This second edition specifies the newest version of the Java virtual machine and provides a fascinating view into the inner workings of the Java 2 platform.
In this book you will find comprehensive coverage of the class file format, the hardware, operating system, and implementation-independent binary format for compiled code. The authors fully describe the instruction set of the Java virtual machine. You will find an entire chapter of examples that demonstrate how to compile code written in the Java programming language into the instruction set of the Java virtual machine. In addition, the book presents a discussion on the vital topic of Java virtual machine threads and their interaction with memory.
All in all, this comprehensive, detailed, and methodical presentation provides the information necessary to implement your own fully compatible Java virtual machine.
0201432943B04062001
Written by two original members of Sun's Java team, this book provides comprehensive coverage of the Java virtual machine. For experienced Java programmers, this second edition brings the specification of the Java virtual machine up to the Java 2 platform, v1.2. A new chapter details the format of each Java virtual machine instruction and the operation it performs.
Synopsis
The nucleus of the Java(TM) 2 platform, the Java(TM) virtual machine is the technology that enables the Java 2 platform to host applications on any computer or operating system without rewriting or recompiling. The Java virtual machine is also responsible for the compactness of applications targeting the Java 2 platform, and is the basis for its security capabilities.
This book was written by those directly responsible for the design and implementation of the Java virtual machine, and is the complete and definitive specification for the technology. It is an essential reference for writers of compilers for the Java programming language and implementors of the Java virtual machine. This second edition specifies the newest version of the Java virtual machine and provides a fascinating view into the inner workings of the Java 2 platform.
In this book you will find comprehensive coverage of the class file format, the hardware, operating system, and implementation-independent binary format for compiled code. The authors fully describe the instruction set of the Java virtual machine. You will find an entire chapter of examples that demonstrate how to compile code written in the Java programming language into the instruction set of the Java virtual machine. In addition, the book presents a discussion on the vital topic of Java virtual machine threads and their interaction with memory.
All in all, this comprehensive, detailed, and methodical presentation provides the information necessary to implement your own fully compatible Java virtual machine.
Ray Duncan
The Guts of Java
If you find the Java scene confusing, it's probably because the term Java is brandished in so many contexts: the Java programming language, the Java application framework, Java development tools, JavaScript support in HTML browsers, the Java applet tags that were added to HTML, network-distributable Java applets, stand-alone Java applications, and last but not least, Java pseudocode and the Java virtual machine (JVM) that runs it. The Java book market is equally confusing -- publishers are in a panic, and are rushing out Java books by the wheelbarrow-load with (for the most part) little attention to quality or any overall strategy.
Here at ERCB, we've received at least a dozen shelf-feet of Java books for review from various publishers, but on close inspection many of them are merely warmed over C/C++ programming books by the usual stable of C/C++ programmer-authors. Since mass-market Java programming tools are such a recent phenomenon, very few of the books are based on serious Java programming experience or address the development of non-trivial, non-toy applications. Still fewer address topics beyond the basic Java programming language or delve beneath the surface of the Java application framework -- in fact, this is the first one I have seen that provides any substantive information about Java pseudo-code and the virtual machine at all.
The first part of The Java Virtual Machine Specification is composed of a somewhat redundant overview of the Java programming language, a introduction to the Java Virtual Machine architecture, and a detailed description of the Java class-file format. The body of the book is devoted to the Java virtual machine opcodes, which are discussed one at a time with their binary representations, stack effects, side effects, exception conditions, and miscellaneous programming notes. The last section covers compiling Java source code to pseudocode, with examples, as well as threads, locks, and some Sun-JVM-specific pseudocode optimizations (which amount to self-modifying opcodes).
Technologically, this is an important book. But as its title indicates, it was designed to be a specification, not a tutorial, so it's tough sledding for the most part and it will be useful mainly as a reference. The hands-on, blow-by-blow description of implementing and debugging a Java Virtual Machine on a mainstream CPU has yet to be written (although I wouldn't be too surprised to learn that Andrew Schulman is already working on it!). The sections of The Java Virtual Machine Specification concerned with code compilation and especially code validation are quite interesting, however, and are well worth your time.
In the Preface, the authors comment that "We intend that this specification should sufficiently document the Java Virtual Machine to make possible compatible clean-room implementations." Did the authors attain this goal? As a past implementor of commercial Forth interpreter/compilers and cross-compilers on many different CPUs, I'm dubious. Forth is based on a virtual machine architecture not terribly dissimiliar to Java, but I don't think I could program my way directly to a working JVM that would run any ol' Java applet I found on the Internet, using just the information supplied here. The descriptions of "frames" and the class loading/linking process are a bit too abstract, and the authors take for granted a fairly deep understanding of C++ implementation strategies. Additionally, a number of machine-dependent issues are not mentioned at all. For example, the mapping of Java-level graphic operations onto machine- or system-specific graphic APIs -- and how such calls from the AWT are passed through or around the JVM -- is left completely to the imagination.
Still, this book is the only game in town at this point for developers of Java compilers, JVMs, and Java debuggers.--Dr. Dobb's Electronic Review of Computer Books
Editorials
Ray Duncan
The Guts of Java
If you find the Java scene confusing, it's probably because the term Java is brandished in so many contexts: the Java programming language, the Java application framework, Java development tools, JavaScript support in HTML browsers, the Java applet tags that were added to HTML, network-distributable Java applets, stand-alone Java applications, and last but not least, Java pseudocode and the Java virtual machine (JVM) that runs it. The Java book market is equally confusing -- publishers are in a panic, and are rushing out Java books by the wheelbarrow-load with (for the most part) little attention to quality or any overall strategy.
Here at ERCB, we've received at least a dozen shelf-feet of Java books for review from various publishers, but on close inspection many of them are merely warmed over C/C++ programming books by the usual stable of C/C++ programmer-authors. Since mass-market Java programming tools are such a recent phenomenon, very few of the books are based on serious Java programming experience or address the development of non-trivial, non-toy applications. Still fewer address topics beyond the basic Java programming language or delve beneath the surface of the Java application framework -- in fact, this is the first one I have seen that provides any substantive information about Java pseudo-code and the virtual machine at all.
The first part of The Java Virtual Machine Specification is composed of a somewhat redundant overview of the Java programming language, a introduction to the Java Virtual Machine architecture, and a detailed description of the Java class-file format. The body of the book is devoted to the Java virtual machine opcodes, which are discussed one at a time with their binary representations, stack effects, side effects, exception conditions, and miscellaneous programming notes. The last section covers compiling Java source code to pseudocode, with examples, as well as threads, locks, and some Sun-JVM-specific pseudocode optimizations (which amount to self-modifying opcodes).
Technologically, this is an important book. But as its title indicates, it was designed to be a specification, not a tutorial, so it's tough sledding for the most part and it will be useful mainly as a reference. The hands-on, blow-by-blow description of implementing and debugging a Java Virtual Machine on a mainstream CPU has yet to be written (although I wouldn't be too surprised to learn that Andrew Schulman is already working on it!). The sections of The Java Virtual Machine Specification concerned with code compilation and especially code validation are quite interesting, however, and are well worth your time.
In the Preface, the authors comment that "We intend that this specification should sufficiently document the Java Virtual Machine to make possible compatible clean-room implementations." Did the authors attain this goal? As a past implementor of commercial Forth interpreter/compilers and cross-compilers on many different CPUs, I'm dubious. Forth is based on a virtual machine architecture not terribly dissimiliar to Java, but I don't think I could program my way directly to a working JVM that would run any ol' Java applet I found on the Internet, using just the information supplied here. The descriptions of "frames" and the class loading/linking process are a bit too abstract, and the authors take for granted a fairly deep understanding of C++ implementation strategies. Additionally, a number of machine-dependent issues are not mentioned at all. For example, the mapping of Java-level graphic operations onto machine- or system-specific graphic APIs -- and how such calls from the AWT are passed through or around the JVM -- is left completely to the imagination.
Still, this book is the only game in town at this point for developers of Java compilers, JVMs, and Java debuggers.--Dr. Dobb's Electronic Review of Computer Books