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

Ioi Lam iklam at openjdk.java.net
Thu May 5 05:59:19 UTC 2022


On Wed, 4 May 2022 18:29:22 GMT, Johan Sjölén <duke at openjdk.java.net> 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.

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

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


More information about the hotspot-runtime-dev mailing list