JIT compiler optimizations
There are three key components of the JVM: a class loader that initializes and links classes and interfaces; runtime data, which includes memory allocation; and the execution engine. This latter component, the execution engine, is the focus of this section.
The core responsibility of the execution engine is to convert bytecode so that it can be executed on the host central processing unit (CPU). There are three primary implementations of this process:
- Interpretation
- Ahead-of-Time (AOT) compilation
- JIT compilation
We will take a cursory look at interpretation and AOT compilation before diving into JIT compilation optimizations.
Interpretation
Interpretation is a technique that the JVM can use to read and execute bytecode without converting it into machine code native to the host CPU. We can invoke this mode by using the java
command in a terminal window. Here is an example:
$ java Main.java
The only real advantage of using...