wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes JIT compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JIT compiler" Watch "JIT compiler" New topic
Author

JIT compiler

Sanyev Babu
Ranch Hand

Joined: Dec 18, 2003
Posts: 132
Is it true that JIT compilers produce native machine code rather than byte code? I read in a book that since JIT compilers produce native machine code the program runs faster. If it produce native machine code then how can it be platform independent?
leo donahue
Ranch Hand

Joined: Apr 17, 2003
Posts: 327
Originally posted by Sanyev Babu:
Is it true that JIT compilers produce native machine code rather than byte code? I read in a book that since JIT compilers produce native machine code the program runs faster. If it produce native machine code then how can it be platform independent?

I was just reading about this in "Head First Java".

Your java code will run on any JVM. However, each JVM is not platform-independent. Each JVM is written for a particular operating system and uses native code to translate your crossplatform bytecode into something the underlying system platform understands."


Thanks, leo
Sanyev Babu
Ranch Hand

Joined: Dec 18, 2003
Posts: 132
I was asking if the output of a JIT compiler is a native machine code then how can the program be platform independent. if you are compiling a java source file the compiler generates a class file which will be used by the JVM at runtime. but if you are using a JIT compiler then what is the output? is it a class file in byte code or an executable in machine code or does the JIT compiler also performs the functions of the JVM. I don't have any idea about JIT compilers. any explanations could be helpful.
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
My understanding is that the compiler output is always in standard java byte codes able to be interpreted by any jre. The jre will assemble the byte code when it runs it for the first time. I do notice that running a button for the first time is slower than the second and further times.


The nice thing about Standards is that there are so many to choose from!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JIT compiler