RFR: 8318484: Initial version of cdsConfig.hpp

Ioi Lam iklam at openjdk.org
Thu Oct 19 19:59:02 UTC 2023


On Thu, 19 Oct 2023 06:54:05 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> This is the first step for [JDK-8318483 - Move CDS configuration management into cdsConfig.hpp](https://bugs.openjdk.org/browse/JDK-8318483)
>> 
>> - Remove `Arguments::is_dumping_archive()` and `Arguments assert_is_dumping_archive()`
>> - Add the following new APIs
>> 
>> 
>> class CDSConfig {
>>   static bool is_dumping_archive();
>>   static bool is_dumping_static_archive();
>>   static bool is_dumping_dynamic_archive();
>>   static bool is_dumping_heap();
>> };
>> 
>> 
>> - Convert some use of `DumpSharedSpaces` and `DynamicDumpSharedSpaces` to these new APIs
>> 
>> (More APIs will be added in future sub tasks of [JDK-8318483](https://bugs.openjdk.org/browse/JDK-8318483))
>
> src/hotspot/share/cds/metaspaceShared.cpp line 778:
> 
>> 776: 
>> 777: #if INCLUDE_CDS_JAVA_HEAP
>> 778:   if (CDSConfig::is_dumping_heap()) {
> 
> This seems a new condition. Why is it needed now?

This was a bug uncovered during refactoring. `StringTable::allocate_shared_strings_array()` used to assert `DumpSharedSpaces`. However, this function is useful only in a more limited scope (`CDSConfig::is_dumping_heap()` which is a subset of `DumpSharedSpaces`). So after changing the assert in  `StringTable::allocate_shared_strings_array()`, I have to change the condition where this function is called.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16257#discussion_r1366041643


More information about the serviceability-dev mailing list