Daniel Strmečki - a month ago
Just-in-time Compilation in JVM
Programming languages are classified based on their levels of abstraction. Java is a high-level language, so it needs to be translated to native code for execution. This can be achieved by either compilation or interpretation. However, the JVM seeks to take advantage of both.
The javac command-line tool compiles Java source code into Java class files containing platform-neutral bytecode, not native executable code. To better understand how the JVM executes bytecode, we will need to take a deeper look into its architecture.
The JVM was designed with portability in mind. Thus, it initially uses an interpreter to execute all bytecode. The JIT compiler kicks-in later to boost performance. It compiles bytecode to native code for repeated method calls. In this talk we will explore the two different JIT compilers used by the JVM. We will explain the tiered compilation concept and its five compilation levels.
At the end of this lecture, you will be able to explain how a combination of an interpreter and a JIT compiler enables both high performance and platform-neutral execution of your Java code.