RFR: JDK-8302989: Add missing INCLUDE_CDS checks

Ioi Lam iklam at openjdk.org
Mon Feb 27 10:11:06 UTC 2023


On Tue, 21 Feb 2023 14:42:38 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> The cds only coding in hotspot is usually guarded with the INCLUDE_CDS macro so that it can be removed at compile time in case the correct configure flags are set.
> However at some places INCLUDE_CDS is missing and should be added.
> 
> One question - should (additionally to the UseSharedSpaces code section)  the DumpSharedSpaces code sections be guarded as well with INCLUDE_CDS macros ?

It may be more profitable (and less work) if we change these variables to `const` when CDS is disabled:


extern bool DumpSharedSpaces;
extern bool DynamicDumpSharedSpaces;
extern bool RequireSharedSpaces;
extern "C" {
// Make sure UseSharedSpaces is accessible to the serviceability agent.
extern JNIEXPORT jboolean UseSharedSpaces;
}


But some changes may be needed in SA.

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

PR: https://git.openjdk.org/jdk/pull/12691


More information about the hotspot-dev mailing list