RFR: 8370914: C2: Reimplement Type::join [v7]
Quan Anh Mai
qamai at openjdk.org
Thu Jan 8 08:17:48 UTC 2026
On Thu, 8 Jan 2026 07:46:34 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
>> But checking the bit is also looking into the details of the types, right? Trying to answer whether a value can be negative with `_lo >= 0` seems to be the most straightforward approach to me. Anyway, the internal details of `TypeInt` are designed to be exposed, and we use them all the time. The methods act more as utilities than encapsulations.
>
>> But checking the bit is also looking into the details of the types, right?
>
> yes, and if it's done in `AbsNode`, I wouldn't be happy either. But if it's done in `TypeInt`, it's fine.
>
>> Anyway, the internal details of TypeInt are designed to be exposed, and we use them all the time. The methods act more as utilities than encapsulations.
>
> That's exactly what I'm challenging. I think adding some new abstract domains and make use of them would be easier if we don't look inside the details all the time. In particular, we are rarely doing very specialized things, mostly abstract integer with a value, or abstract integers together... I think looking at the bounds of ranges everywhere makes improvements to the type system harder, and the local code less clear.
I see, can we leave it for a future cleanup? I see there are around 15 places where we do `_lo >= 0`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28051#discussion_r2671358540
More information about the hotspot-compiler-dev
mailing list