
As with a standard compiler, there’s the generation to intermediate code, optimization, and then the production of machine native code.Ī profiler is a special component of the JIT compiler responsible for finding hotspots. The JIT compiler compiles the entire method’s bytecode to machine native code, so it can be reused directly. However, the JVM uses the JIT compiler based on how frequently a method is called. The JIT compiler doesn’t completely replace the interpreter.

Java makes use of the JIT compiler to overcome this issue. The main disadvantage of an interpreter is that every time a method is called, it requires interpretation, which can be slower than compiled native code.
