This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JIT compiler  RSS feed

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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."

 
Sanyev Babu
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!