RFR: 8360192: C2: Make the type of count leading/trailing zero nodes more precise [v3]

Qizheng Xing qxing at openjdk.org
Tue Jun 24 09:31:30 UTC 2025


On Mon, 23 Jun 2025 10:40:13 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/countbitsnode.cpp line 53:
>> 
>>> 51:   if (t == Type::TOP) return Type::TOP;
>>> 52:   const TypeInt* ti = t->isa_int();
>>> 53:   if (ti) {
>> 
>> Implicit null check not allowed by style guide :)
>> 
>> https://github.com/openjdk/jdk/blob/master/doc/hotspot-style.md
>> 
>>> Do not use ints or pointers as (implicit) booleans with &&, ||, if, while. Instead, compare explicitly, i.e. if (x != 0) or if (ptr != nullptr), etc.
>
> I know it was like that before, but when we touch code we should fix it :)

Updated. Thanks for pointing them out.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25928#discussion_r2163444606


More information about the hotspot-compiler-dev mailing list