RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v39]
Quan Anh Mai
qamai at openjdk.org
Thu Jan 30 15:07:12 UTC 2025
On Thu, 30 Jan 2025 12:52:16 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>>
>> include
>
> src/hotspot/share/opto/rangeinference.cpp line 59:
>
>> 57: // This class deals with each interval with both bounds being >= 0 or < 0 in
>> 58: // the signed domain. We call it Simple because a canonicalized TypeIntPrototype
>> 59: // may contain 1 or 2 SimpleCanonicalResult.
>
> Aha! Now I understand why "Simple"!
> It could be nice if you had a constructor where you validate the "simple" constraint, i.e. that we are in either of these cases:
> - empty.
> - `[lo, hi] >= 0` and `[lo, hi] == [ulo, uhi]`
> - `[lo, hi] < 0` and `[ulo, uhi] >= 2^31` and `[lo, hi] = [(jint)ulo, (jint)uhi]`
> I did understand this correctly, right?
Defining a constructor prevents usage of brace initialization :(
> src/hotspot/share/opto/rangeinference.cpp line 66:
>
>> 64: bool _present; // whether this is an empty set
>> 65: RangeInt<U> _bounds;
>> 66: KnownBits<U> _bits;
>
> Could these be const? That would additionally guaratee that nobody can come in and violate the "simple" constraint.
Making a member const would make the whole object kind of const, which is not ideal here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r1935767997
PR Review Comment: https://git.openjdk.org/jdk/pull/17508#discussion_r1935769385
More information about the hotspot-compiler-dev
mailing list