3

The JIT compiler compiles bytecode into some target form, at runtime, before the code is about to be executed. The HotSpot has details about the specific platform where the code is running and can produce highly optimized code for that machine.

This answer on SO seems to suggest that both of these work as one unit, while this answer on SO seems to suggest that they are independent of each other.

In Oracle's JVM, are the HotSpot and JIT two different systems, or just one system ?

Community
  • 1
  • 1
Parag
  • 12,093
  • 16
  • 57
  • 75
  • 3
    Oracle's HotSpot is an implementation of a JIT compiler that does "hot spot" analysis. HotSpot is the name of that specific implementation, JIT is a general concept. – Mat Oct 26 '12 at 06:53
  • 1
    HotSpot is an implementation of the Java Virtual Machine. HotSpot has 2 JIT-compilers (client and server). In that sense the JIT-compiler is a part of the VM (HotSpot) in this case. – Rickard Oct 30 '12 at 11:43
  • I think the thread (linked in the question) that suggests hotspot and JIT are independent, probably refers to HotSpot as a concept, and it separates HotSpot and JIT as two different concepts, where HotSpot uses profiling data to determine what to compile, and JIT simply compiles something before executing it. So, from that perspective would it be fair to say that HotSpot uses JIT... – Parag Oct 31 '12 at 08:23
  • Rethinking about my question, makes me think that perhaps it wasn't a very good question :-) – Parag Oct 31 '12 at 08:23
  • 1
    Some JITs, e.g. HotSpot, can run code without compiling (in interpreter mode). If the code is executed many times (option `-XX:CompileThreshold=###` where ### is the execution count), it will be JIT-compiled. And other JITs, like Google's V8 for Javascript can't interpret code and they will compile it at first call or entry. – osgx Dec 07 '12 at 19:49
  • FYI https://docs.oracle.com/javase/9/jrockit-hotspot/compilation-optimization.htm#JRHMG142 – KunYu Tsai Jan 07 '19 at 05:11

0 Answers0