RFR: 8150720: Cleanup code around PrintOptoStatistics

Claes Redestad claes.redestad at oracle.com
Fri Feb 26 16:23:43 UTC 2016

While LogCompilation is diagnostic, Parse::print_statistics is the only 
place where any of the affected counters are printed out, and it's not 
defined in product binaries.

If there's agreement that PrintOptoStatistics should be made diagnostic 
(or converted to UL) then I won't object, but if so I'd insist in 
wrapping the values in PerfCounters, since that makes them more useful 
as well as pads the values (haven't measured whether or not these cause 
any measurable false sharing, but global, non-atomically updated values 
do make me uneasy).

I'd prefer pushing this as-is and follow-up on converting some or all 
counters to diagnostic separately, though.



On 2016-02-26 16:59, Vladimir Ivanov wrote:
> PrintOptoStatistics is not the only flag which guards the usage:
> src/share/vm/runtime/java.cpp:
> #ifdef COMPILER2
>   if ((PrintOptoStatistics || LogVMOutput || LogCompilation) && 
> UseCompiler) {
>     FlagSetting fs(DisplayVMOutput, DisplayVMOutput && 
> PrintOptoStatistics);
>     Compile::print_statistics();
> 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