RFR: 8313905: Checked_cast assert in CDS compare_by_loader

Dean Long dlong at openjdk.org
Wed Aug 9 19:51:58 UTC 2023


On Wed, 9 Aug 2023 12:28:50 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> Fix a checked_cast<> assert caused by changes to CDS code, but not using address calculations for comparison operators for class loaders or InstanceKlass pointers.
> Tested with tier1-4 on linux-x64-debug and windows-x64-debug.

src/hotspot/share/utilities/globalDefinitions.hpp line 1341:

> 1339:        : ((uintptr_t)k0 == (uintptr_t)k1) ? 0 : 1);
> 1340: }
> 1341: 

I was thinking this would hurt performance, but on x86 and aarch64 the compiler generates conditional moves instead of conditional branches.
I don't like using uintptr_t here.  Can't we compare void* or better yet K*?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15208#discussion_r1289103850


More information about the hotspot-dev mailing list