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

Calvin Cheung ccheung at openjdk.org
Wed May 21 21:34:51 UTC 2025


On Wed, 21 May 2025 19:56:00 GMT, Ioi Lam <iklam 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()`.

LGTM

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

Marked as reviewed by ccheung (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25365#pullrequestreview-2859175565


More information about the hotspot-dev mailing list