• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM internal working principle

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

The JVM Contains both JIT(Just In Time Compiler) and Java interpreter.

1) What is the differrence between the JIT(Just In Time Compiler) and Java interpreter, since both converts BYTECODE into native machine code

2)What is the need of both compiler and interpereter in JVM.

3)please tell me the process of convertion of byte code to native .

4)It should convert first to the Assembly language and then to machinecode right
 
Campbell Ritchie
Sheriff
Pie
Posts: 49363
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
santhosh.R gowda wrote:Dear All

The JVM Contains both JIT(Just In Time Compiler) and Java interpreter.

1) What is the differrence between the JIT(Just In Time Compiler) and Java interpreter, since both converts BYTECODE into native machine code
They are parts of the same program. The JIT bit repeats the compilation from bytecode to native for parts of code which appear to be used frequently, so as to improve performance.

2)What is the need of both compiler and interpereter in JVM.
The compiler can validate the code and check it for many errors. That validation need not be repeated, otherwise execution would be very slow.

3)please tell me the process of convertion of byte code to native .
The compiler takes bytecode and coverts it into native code. Or, put differently, you will have to search

4)It should convert first to the Assembly language and then to machinecode right
No, bytecode is very similar to assembler already.
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, bytecode is very similar to assembler already.

How bytecode is similar to assembler how its is going to differentiate btewen the processor architecture.Please give me the link to know in detail of the working principle
 
Campbell Ritchie
Sheriff
Pie
Posts: 49363
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the Java™ Virtual Machine Specification. It can vary from implementation to implementation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic