compiled method info
rednaxelafx at gmail.com
Thu May 3 15:07:50 PDT 2012
+1 with John, Google is your friend when you start investigating things, especially when the top hits are pretty good.
On 2012-5-4, at 4:20, Xin Tong <xerox.time.tech at gmail.com> wrote:
> On Thu, May 3, 2012 at 4:13 PM, Christian Thalinger
> <christian.thalinger at oracle.com> wrote:
>> On May 3, 2012, at 11:54 AM, Xin Tong wrote:
>>> I am new to hotspot JVM. I am wondering how can I get a log of all the
>>> method compiled
>> You can print the compiled methods with -XX:+PrintCompilation.
> This will print the compiled method to the stdout, is there a way to
> force it to some output file ?
You can learn more about all available VM options in the *globals.hpp files.
Supposing you can read Chinese, there's a thread that I posted some time ago that had a list of all *globals.hpp files in it: http://hllvm.group.iteye.com/group/topic/27945
In runtime/globals.hpp, you can find the flags LogVMOutput and LogFile that should meet your needs. Use them like this (if you're using a product build):
-XX:+UnlockDiagnosticVMOptions -XX:+LogVMOutput -XX:LogFile=<file_path>
The default path for the log is ./hotspot.log.
>>> and how can i get the intermediate representation
>> This is more complicated. Do you mean the graph that's produced during the compile?
>>> optimizations performed on one particular method ?
> Yes. I used to work on some other compiler framework in which one is
> able to print the graph after every optimization.
Search for C1Visualizer and IdealGraphVisualizer and read their manual. Should be enough to get you started.
>> Depends on the compiler used. You might get an idea what's going on using -XX:+TimeCompiler (this is only available in a non-product build).
> I used make all to build openJDK. however, all the developer options
> are not available. How do i make a non-product build. I do not want a
> debug build, as debug build tend to run slower than prod build.
That's what a fastdebug build is for. It's faster than a (slow) "debug" build, even though slower than a product build. You could refer to a script that Charles Nutter wrote for building HotSpot:
https://gist.github.com/1148321 . Use "build.sh fastdebug" to get a fastdebug build.
> -- Xin
>> -- Chris
More information about the hotspot-compiler-dev