RFR: 8286117: Remove unnecessary indirection and unused code in UL

Robbin Ehn rehn at openjdk.java.net
Thu May 5 06:24:18 UTC 2022


On Thu, 5 May 2022 05:56:15 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> This PR cleans up some minor annoyances in the UL code.
>> 
>> Note that the change from `LogImpl` to `LogTagSet` is equivalent, we're essentially inlining the calls that `LogImpl` would have made. This simplifies understanding ("why do we need `LogImpl` here?" was my question, answer: We don't!)'
>
> src/hotspot/share/logging/log.hpp line 184:
> 
>> 182: 
>> 183:   static bool is_enabled() {
>> 184:     return LogTagSetMapping<T0, T1, T2, T3, T4, GuardTag>::tagset().is_level(level);
> 
> This removes an abstraction and makes the code more verbose. I don't see the value of doing this, especially when LogImpl is used by macros like `log_info()`, `log_debug()`, etc, which are the primary interface to UL. With this change, people who wonder how `log_info()` works would need to understand more implementation details than before.

I think the point was to make the code more explicit/verbose since this is the implementation (thus removing abstraction inside the implementation), thus making it easier to understand what it does.

I'm fine with as is or with this change.

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

PR: https://git.openjdk.java.net/jdk/pull/8541


More information about the hotspot-runtime-dev mailing list