Is there any way to do an assembly dump of the native code generated by the Java just-in-time compiler?
And a related question: Is there any way to use the JIT compi
If Amigable Clark Kant thought your question was heresy, he will really flip out over this answer. File this under "what is possible" not necessarily under "Justin recommends". :-)
One option is to use IKVM.NET to process your Java code using Mono. IKVM.NET allows you to run Java code on top of .NET or the Mono CLR. Some might say that you are skipping the JVM this way although it would be more accurate to say that IKVM.NET is really an implementation of the JVM that runs on the CLR.
At any rate, if you do this, you now have the option of doing Ahead-of-time (AOT) compilation of your code with Mono. That is, you can compile your code all the way down to machine native which means that you do not need either the CLR or the JVM at runtime.
Unlike what Jesper says above, using AOT compilation can actually result in better performance. While it is true that the JVM (and the CLR) perform some optimizations at runtime that are not possible at compile time, the reverse is also true. Also, one of the options is to use LLVM for code generation which typically results in better performance.
Here is the pipeline in a nutshell:
Your code -> IKVM.NET -> Mono -> LLVM -> Native executable
Or, just use a Java compiler that is designed to AOT generate native executables from the start (like GCJ or Excelsior Jet).
One place that the Mono/IKVM.NET option might be useful is if you want to use a Java library as part of an iPhone app (using MonoTouch). The App Store only allows native binaries.
EDIT: You can also use the LLVM VMKit to AOT compile Java code to machine code. This is conceptually the same process I described with Mono but keeping that nasty CIL stuff out of the picture.