RFR: 8150720: Cleanup code around PrintOptoStatistics

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Fri Feb 26 15:59:51 UTC 2016

PrintOptoStatistics is not the only flag which guards the usage:

#ifdef COMPILER2
   if ((PrintOptoStatistics || LogVMOutput || LogCompilation) && 
UseCompiler) {
     FlagSetting fs(DisplayVMOutput, DisplayVMOutput && 

LogCompilation is diagnostic, so it is possible to dump some of the 
counters in product binaries.

You can even make PrintOptoStatistics diagnostic as well. It will 
significantly the cleanup part ;-)

Best regards,
Vladimir Ivanov

On 2/26/16 4:31 PM, Claes Redestad wrote:
> On 2016-02-26 14:20, Vladimir Ivanov wrote:
>> I'm curious why not expose them as PerfCounters then.
> This might make sense for some of these, but I felt that needs to be
> evaluated
> on a case-by-case basis and should be backed up by request for making
> this particular
> data available in product builds. I don't think this cleanup needs to be
> blocked while
> investigating other options for making potentially useful data available.
> Thanks!
> /Claes
>> Best regards,
>> Vladimir Ivanov
>> On 2/26/16 2:40 PM, Claes Redestad wrote:
>>> Hi,
>>> src/share/vm/opto/parse1.cpp currently defines a number of global
>>> counters that is used to collect some statistics. Some of these counters
>>> are incremented in product builds, but ever only displayed in
>>> non-product builds if run with -XX:+PrintOptoStatistics.
>>> This patch masks such counters from product builds, removes a few
>>> counters that were never read, fixes an issue with implicit_null_throws
>>> which was never incremented in current code (seems it was moved to
>>> SharedRuntime a long time ago without updating print_statistics) and
>>> removes an unused enum (InlineStyle):
>>> webrev: http://cr.openjdk.java.net/~redestad/8150720/webrev.00/
>>> bug: https://bugs.openjdk.java.net/browse/JDK-8150720
>>> Testing: RBT --test hotspot/test/:hotspot_all, manual verification that
>>> -XX:+PrintOptoStatistics prints out a count for implicit NPE's thrown
>>> Thanks!
>>> /Claes

More information about the hotspot-compiler-dev mailing list