RFR: 8364111: InstanceMirrorKlass iterators should handle CDS and hidden classes consistently [v3]

Thomas Stuefe stuefe at openjdk.org
Tue Jul 29 06:56:54 UTC 2025


On Mon, 28 Jul 2025 10:51:11 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> See the bug for more investigation. I think the root cause is already fixed in one of the `InstanceMirrorKlass` iterators, but not in the other one. Additionally, only one iterator handles the hidden classes. Also, there is a stale comment about CMS that apparently prevents us from asserting `is_primitive`, which is not relevant anymore.
>> 
>> So this PR commons out the metadata handling on both iterators, which fixes the GenShen+CDS bug, likely fixes hidden classes bug somewhere, and prevents the omission like this from happening again.
>> 
>> Additional testing:
>>  - [x] Linux x86_64 server fastdebug, Generational Shenandoah + CDS bugs are not reproducing now
>>  - [x] Linux x86_64 server fastdebug, `tier1`
>>  - [x] Linux x86_64 server fastdebug, `all`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Better comment

I wondered briefly whether the allowance ("CLD = null is okay for newly-loaded classes") should be also made in https://github.com/openjdk/jdk/blob/4669005123420d8dbe86740dd9bcbee04735bc4f/src/hotspot/share/memory/iterator.inline.hpp#L57-L59 

But since we now handle mirror->referee Klass correctly in IMK, this only path affects oop->its Klass, and no instances exist yet for that Klass, right?

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

PR Comment: https://git.openjdk.org/jdk/pull/26477#issuecomment-3130944972


More information about the hotspot-dev mailing list