NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.1+)
Contents | Index | Glossary | Prev | Next
Just-in-Time (JIT) Compiler
Java supports the use of native RISC instructions instead of Java bytecode to improve Java run-time
performance. To generate RISC instructions, run the Java interpreter with the -jit option.
The -jit option is a Compaq extension to standard Java. -jit performs just-in-time (JIT) compilation on each
class, translating the class to native RISC code when it is loaded. The -nojit option prevents the Java interpreter
from translating the class to native RISC code. The default is -jit.
The JIT compiler is contained within the JVM. The JIT compiler uses method-by-method translation. That is, it
translates each method as it is loaded, rather than translating an entire class.
When the JVM runs in interpreter mode (without the JIT compiler), it works directly with the Java bytecode,
interpreting each instruction at run time, as the following figure shows.
Interpreter Mode
Legend
Java Virtual Machine (JVM)1.
Run-time bytecode interpretation2.
Java bytecode3.
When the JVM runs in JIT compiler mode (with the JIT compiler), the JIT compiler translates Java bytecode to
native RISC instructions. The JVM then executes those instructions. During a single run of the Java interpreter,
the JVM can use the same method multiple times, but the JIT compiler translates that method only once. After the
JIT compiler translates a method, the JVM uses the method's native code instead of Java bytecode.
Just-in-Time (JIT) Compiler Mode