RFR: 8313905: Checked_cast assert in CDS compare_by_loader [v2]

Dean Long dlong at openjdk.org
Wed Aug 9 20:55:31 UTC 2023


On Wed, 9 Aug 2023 20:37:29 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.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Ha, didn't need the casts after all.

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

> 1337: template<typename K> int primitive_compare(const K& k0, const K& k1) {
> 1338:   return (((uintptr_t)k0 < (uintptr_t)k1) ? -1
> 1339:        : ((uintptr_t)k0 == (uintptr_t)k1) ? 0 : 1);

Suggestion:

  return k0 < k1 ? -1 : k0 == k1 ? 0 : 1;

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

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


More information about the hotspot-dev mailing list