问题
I would like to learn what native instructions Java's JIT compiler generates when it loads a class file. Is there any way of knowing it?
I am working in Linux on a 586 processor. And I am using Sun's JDK 1.6 update 21. Is there any tool that I can use to find out what I am looking for?
回答1:
You probably need -XX:+PrintOptoAssembly
, but you'd need a debug build of the JVM. The links to the binary distributions seem not to be available any longer, so you might have to build it from source: http://download.java.net/jdk6/6u10/archive/
If you're planning to try this with OpenJDK 7 as well, this might be of interest: http://wikis.sun.com/display/HotSpotInternals/PrintAssembly
来源:https://stackoverflow.com/questions/3578992/how-to-find-native-instructions-generated-from-class-file