On Tue, 15 Oct 2024 19:08:20 GMT, Dan Heidinga <heidi...@openjdk.org> wrote:

>> Ioi Lam has updated the pull request with a new target base due to a merge 
>> or a rebase. The pull request now contains 29 commits:
>> 
>>  - @DanHeidinga comments -- added ConcurrentHashMap::runtimeSetup() to init 
>> NCPU to runtime value; also use the same runtimeSetup() pattern to call 
>> registerNatives() for Class.java and Unsafe.java
>>  - Merge branch 
>> 'jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke' into 
>> jep-483-step-07-8293336-store-lambda-forms-in-cds-archive
>>  - Fixed JDK-8341988: jstack launched with AOT cache created with 
>> -XX:+AOTClassLinking crashes
>>  - 8341600: [premain] Automatic aot-init of classes used by java.lang.invoke
>>  - @adinn comments
>>  - improve checks for not changing <clinit> order for aot linking of lambda; 
>> added comprehensive test cases: AOTLinkedLambdasApp::testClinitOrder()
>>  - Clean up of aotClassInitializer and cdsHeaVerifier; added lambda test 
>> cases for <clinit> order of app classes
>>  - Merge branch 
>> 'jep-483-step-06-8311071-avoid-soft-refs-in-java-lang-invoke' into 
>> jep-483-step-07-8293336-store-lambda-forms-in-cds-archive
>>  - Require all <clinit> of supertypes of aot-inited classes to be executed 
>> in assembly phase
>>  - Limit the use of AOTHolder
>>  - ... and 19 more: https://git.openjdk.org/jdk/compare/e46b910a...382446d4
>
> src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java line 
> 599:
> 
>> 597: 
>> 598:     /** Number of CPUS, to place bounds on some sizings */
>> 599:     static @Stable int NCPU;
> 
> I would prefer to not mark this `@Stable` at this time as it would have 
> different assembly and runtime values and instead add a followup RFE to 
> investigate adding it in later.

We have been archiving `ConcurrentHashMap` objects for many JDK releases (to 
support archiving of modules) and `NCPU` would change between CDS archive dump 
time and program run time. We have not seen any problems, so I think it's safe 
to use the `@Stable` annotation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21143#discussion_r1801804442

Reply via email to