RFR: 8316229: Enhance class initialization logging [v2]

Aleksey Shipilev shade at openjdk.org
Wed Sep 20 09:21:49 UTC 2023


On Wed, 20 Sep 2023 01:54:19 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/oops/instanceKlass.cpp line 773:
>> 
>>> 771:   MonitorLocker ml(current, _init_monitor);
>>> 772: 
>>> 773:   bool debug_logging_enabled = log_is_enabled(Debug, class, init);
>> 
>> Here and later: Do we need to peel off the `log_is_enabled` check into a separate variable? We don't do it in most (all?) of our places.
>
> ha! You'll see that was my last separate commit. It bugs me when we keep checking `log_is_enabled` over and over in the same chunk of code. Even though it is supposed to be fast it is surely faster with a local?

Well, I prefer to stack all logging code in one place. But I have no strong opinion about this one.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15809#discussion_r1331328613


More information about the hotspot-dev mailing list