RFR: 8320935: Move CDS config initialization code to cdsConfig.cpp [v2]

Ioi Lam iklam at openjdk.org
Sat Dec 2 00:38:58 UTC 2023


On Wed, 29 Nov 2023 21:53:06 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   fixed indentation
>
> src/hotspot/share/cds/cdsConfig.cpp line 34:
> 
>> 32: #include "logging/log.hpp"
>> 33: #include "runtime/arguments.hpp"
>> 34: #include "runtime/java.hpp"
> 
> I was able to build with your patch without including `java.hpp`.
> The #include java.hpp could also be removed from arguments.cpp.

cdsConfig.cpp needs the declaration of `vm_exit_during_initialization()` from java.hpp. Although java.hpp is included by arguments.hpp, we usually try to avoid such indirectly inclusions. Otherwise if arguments.hpp is changed to no longer include java.hpp, then cdsConfig.hpp will fail to compile.

I am not sure about arguments.cpp -- if java.hpp is already included by arguments.hpp, do we need to explicitly include it in arguments.cpp? I'll leave that alone in this PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16868#discussion_r1412682898


More information about the serviceability-dev mailing list