RFR: 8357504: Refactor the assignment of loader bits in InstanceKlassFlags

Ioi Lam iklam at openjdk.org
Thu May 22 04:07:55 UTC 2025


On Wed, 21 May 2025 20:59:19 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> These bits are renamed to
>> 
>> 
>> flag(defined_by_boot_loader , 1 << 7) /* defining class loader is boot class loader */ \
>> flag(defined_by_platform_loader , 1 << 8) /* defining class loader is platform class loader */ \
>> flag(defined_by_app_loader , 1 << 9) /* defining class loader is app class loader */ \
>> 
>> 
>> They are not set exactly once inside `ClassFileParser::fill_instance_klass()`, to avoid race conditions
>> 
>> Also, set these flags even when AOT/CDS is not used -- the cost is trivial. That way, we don't need to worry if a code path might be invalid when AOT/CDS is disabled.
>> 
>> This RFE simplifies the bug fix in https://github.com/openjdk/jdk/pull/25171
>> 
>> For reviewers
>> - The first commit is strictly renaming. No functional changes
>> - The second commit moves the bit setting to `ClassFileParser::fill_instance_klass()`.
>
> Renaming and refactor looks good. Thanks!

Thanks @matias9927 @calvinccheung for the review

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

PR Comment: https://git.openjdk.org/jdk/pull/25365#issuecomment-2899833919


More information about the hotspot-dev mailing list