there are additional XX style parameters in hotspot which aren't enabled in the regular openjdk binaries. they are however in the DEBUG builds, also available as binary downloads.
you can find some of the undocumented ones in c2_globals.hpp. product apparently means the flag is available in the production release. notproduct flags aren't found in the regular release of the jdk.
well, the jdk now includes scalar replacement. it means leaving out the creation of an object that doesn't escape, handling all it's fields with registers, and having all the non-created object's methods deal with the values in the registers, as appropriate.
escape analysis is disabled by default, so turn it on with -XX:+DoEscapeAnalysis. eliminate allocations a.k.a. scalar replacement is enabled by default when you turn on escape analysis.
with your debug JDK:
-XX:+PrintEliminateAllocationsand
-XX:+PrintEscapeAnalysisand you are off to see the wizard. sweet stuff. and finally the compulsory notes. I especially found this quote from Brian Goetz to be enlightening:
To write a test program that will really test what you think it does, you have to understand what the compiler is going to do to it, the performance characteristics of the dynamically compiled code, and how the generated code differs from that of typical, real-world code that uses the same constructs. Without that degree of understanding, you won't be able to tell whether your program measures what you want it to.enjoy!
0 kommenttia:
Post a Comment