What are bytecodes and how does the JVM handle them

前端 未结 6 1564
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 04:33

I heard many times that Java implemments JIT(just-in-time) compilation, and its bytecodes which are portable across platforms get \"interpreted\" by JVM. However, I don\'t r

6条回答
  •  既然无缘
    2020-11-29 05:11

    When you compile something in Java, the compiler generates bytecode. This is native code for the Java Virtual Machine. The JVM then translates the bytecode to native code for your processor/architecture, this is where the JIT happens. Without JIT, the JVM would translate the program one instruction at a time, which is very slow.

提交回复
热议问题