This chapter covers code generation and code optimization in a JVM runtime environment, both as a general concept as well as taking a closer look at the JRockit code generation internals. We start by discussing the Java bytecode format, and how a JIT compiler works, making a case for the power of adaptive runtimes. After that, we drill down into the JRockit JVM. Finally, the reader learns how to control code generation and optimization in JRockit.
You will learn the following from this chapter:
The benefits of a portable platform-independent language such as Java.
The structure of the Java bytecode format and key details of the Java Virtual Machine specification.
How the JVM interprets bytecode in order to execute a Java program.
Adaptive optimizations at runtime versus static ahead-of-time compilation. Why the former is better but harder to do. The "gambling on performance" metaphor.
Why code generation in an adaptive runtime is potentially very powerful.
How...