RFR: 8317761: Combine two versions of print_statistics() in java.cpp [v2]
Ioi Lam
iklam at openjdk.org
Tue Oct 10 17:05:14 UTC 2023
On Tue, 10 Oct 2023 16:50:19 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> call print_method_profiling_data() unconditionally
>
> src/hotspot/share/runtime/java.cpp line 290:
>
>> 288: // TODO: why is this unconditional in non-product builds?
>> 289: print_method_profiling_data();
>> 290: }
>
> I think it should be called unconditional always because we have check inside method.
>
> I think the check in product VM is historical. Originally `print_method_profiling_data()` was called only in NOT_PRODUCT and later [8037970](https://github.com/openjdk/jdk/commit/b21d142f016360986212a941659115c0c96a3426#diff-d9e4fa0ecdd187c3fce3dcb8b0344264134d7746225956636b237e26ce6ad369) add call to PRODUCT under `PrintMethodData` check (there was no this flag check inside method).
> Then [8042727](https://github.com/openjdk/jdk/commit/ead7a2760b46226947dc07548ea0fa4897aef18d) added the flag check inside method to avoid unconditional walk class data (I assume in debug VM). This change made the check before call the method in product version redundant.
Thanks. I removed the `if` check.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16110#discussion_r1352981644
More information about the hotspot-dev
mailing list