On Mon, 22 Jul 2024 14:16:05 GMT, Andrew Haley <a...@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

Reply via email to