I just committed what I have of Shark to icedtea6 hg. Its version number should be taken as an indication of its level of completeness. To build it you need to use ./configure --enable-shark
with a very recent LLVM installed on your system. I’m using 52487…
Month: June 2008
I spent quite a lot of time tracking down a miscompilation in LLVM lately but I’m pretty much back on track now. One fun thing is that I figured out how to add diagnostic options to OpenJDK, so when I eventually release Shark you’ll be able to debug it with the following exciting options:
-XX:SharkStartAt=N
- Start compiling only after N compilation requests. (Use in conjunction with
-XX:+PrintCompilation
.) -XX:SharkStopAfter=N
- Stop compiling after N compilation requests.
-XX:SharkDumpModuleAfter=N
- Dump all generated LLVM bitcode (to
hotspot.bc
) after N compilation requests. -XX:SharkPrintTypeflowAfter=N
- Print the results of the typeflow pass of the Nth compilation request.
-XX:+SharkTraceBytecodes
- Print the name and bci of each bytecode compiled (Handy for crashes).
I tend to use them in pairs, eg -XX:Shark{StartAt,DumpModuleAfter}=17
.
This list will probably get real old real quick, but they’ll all be listed in ports/hotspot/src/share/vm/shark/shark_globals.hpp
.
Keeping the (Java) stack and locals in registers is all very well, but it makes method calls and safepoints tricky since previously everything was on the (Zero) stack where it needed to be and now it isn’t.