RFR: JDK-8302989: Add missing INCLUDE_CDS checks

David Holmes dholmes at openjdk.org
Wed Feb 22 00:28:24 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 ?

The CDS related source code is not 100% compile-time conditionalized. Typically we only exclude code that can't compile without the CDS specific files being compiled. Othercode won't execute due to the value of the "flags" in those cases. If you want to 100% conditionalize CDS related code then you need more changes than just those outlined here.

Are you actually trying to solve a problem or was this just an observation?

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

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


More information about the hotspot-dev mailing list