On Thu, 12 Sep 2024 15:38:18 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:
>> src/hotspot/share/opto/lcm.cpp line 272: >> >>> 270: const TypePtr* tptr; >>> 271: if ((UseCompressedOops || UseCompressedClassPointers) && >>> 272: (CompressedOops::shift() == 0 || >>> CompressedKlassPointers::shift() == 0)) { >> >> Could you explain this change? It seems like it may affect C2's implicit >> null check analysis even for `-XX:-UseCompactObjectHeaders`. In particular, >> for the following configurations, the changed condition evaluates to true >> before the change and false after it, regardless of whether >> `UseCompactObjectHeaders` is enabled: >> >> (!UseCompressedOops, UseCompressedClassPointers, >> CompressedKlassPointers::shift() != 0) >> ( UseCompressedOops, !UseCompressedClassPointers, CompressedOops::shift() != >> 0) > > Hi @robcasloz > > The `CompressedKlassPointers` utility class is not usable anymore with > `-UseCompressedClassPointers`. One change is that if > `UseCompressedClassPointers` is off, `CompressedKlassPointers` stays > uninitialized. And that makes more sense then to rely on the static > initialization values of `CompressedOops::_shift`. Thanks for the explanation. I wonder if the test is necessary at all, or one could simply use `base->get_ptr_type()` unconditionally, which defaults to `base->bottom_type()->isa_ptr()` anyway for non-compressed pointers. But this simplification would be in any case out of the scope of this changeset. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1758356268