Interpreter Implementation

The core of the JVM is a loop that interprets the Java bytecodes. There are between 200 and 256 bytecodes, depending on how the JVM has enhanced the standard set with optimizing extensions. Most of the operations are nearly trivial: pushing literal values, performing simple arithmetic and logic on stacked data, and flow control. Other operations are complex; it takes only one opcode to allocate an array of objects, execute a switch statement, or invoke a method.

Standard Interpreter

A completely untuned JVM uses a bytecode interpreter written in C. Such implementations are nicely portable, but such JVMs established that Java programs run up to 40 times slower than do C++ programs. These JVMs are no longer taken seriously ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.