RFR: 8315066: Add unsigned bounds and known bits to TypeInt/Long [v9]

Vladimir Kozlov kvn at openjdk.org
Thu Sep 5 16:23:54 UTC 2024


On Tue, 3 Sep 2024 23:02:43 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   move static_asserts
>
> Please, fix GHA builds and testing.

> @vnkozlov It is because the result of a `make` can be not a `TypeInt` but an empty type. It would be possible to have a `TypeInt` instance representing the empty set. However, we expose `_lo` and `_hi`, and accessing them of an empty set seems to be a nonsensical operation and potentially dangerous. As a result, I think it is safer we return `Type::TOP` for the empty set.

So why you can't do next?:

const Type* TypeInt::make(jint lo, jint hi, int w) {
  const Type* t = make(TypeIntPrototype<jint, juint>{{lo, hi}, {0, max_juint}, {0, 0}}, w);
  t->is_int();
  return t;
}

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

PR Comment: https://git.openjdk.org/jdk/pull/17508#issuecomment-2332156134


More information about the hotspot-compiler-dev mailing list