RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

Vladimir Ivanov vlivanov at openjdk.org
Tue Jul 23 19:09:41 UTC 2024


On Mon, 22 Jul 2024 14:16:05 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/hotspot/share/oops/klass.cpp line 175:
>> 
>>> 173:     if (secondary_supers()->at(i) == k) {
>>> 174:       if (UseSecondarySupersCache) {
>>> 175:         ((Klass*)this)->set_secondary_super_cache(k);
>> 
>> Does it make sense to assert `UseSecondarySupersCache` in `Klass::set_secondary_super_cache()`?
>
> I kinda hate this because we're casting away `const`, which is UB. I think I'd just take it out, but once I do that, I don't think anything sets `_secondary_super_cache`.

IMO it's OK if C++ runtime omits `_secondary_super_cache` accesses irrespective of whether `UseSecondarySupersCache` is set or not. I'm fine with addressing it separately.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19989#discussion_r1688565818


More information about the core-libs-dev mailing list