RFR: JDK-8302989: Add missing INCLUDE_CDS checks [v2]

Ioi Lam iklam at openjdk.org
Wed Mar 1 10:00:06 UTC 2023


On Wed, 1 Mar 2023 09:24:39 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 ?
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Make SharedSpaces related vars const and false in non CDS mode

src/hotspot/share/utilities/globalDefinitions.hpp line 594:

> 592: #else
> 593: // in non CDS mode do not export it
> 594: extern const bool UseSharedSpaces;

How about this?


const bool RequireSharedSpaces = false;


This will allow the C++ compiler to eliminate all code that depend on this value when `INCLUDE_CDS` is false.

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

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


More information about the hotspot-dev mailing list