RFR: JDK-8302989: Add missing INCLUDE_CDS checks [v3]
David Holmes
dholmes at openjdk.org
Fri Mar 3 01:03:16 UTC 2023
On Thu, 2 Mar 2023 16:27:32 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:
>
> adjust some cds related vars
src/hotspot/share/runtime/arguments.cpp line 1460:
> 1458: #if INCLUDE_CDS
> 1459: UseSharedSpaces = false;
> 1460: #endif
This doesn't make sense - the entire `no_shared_spaces` method is only meaningful on a JVM with CDS. Otherwise `-Xshare:on` should immediately be rejected. ??
src/hotspot/share/runtime/arguments.cpp line 2675:
> 2673: xshare_auto_cmd_line = true;
> 2674: // -Xshare:off
> 2675: } else if (match_option(option, "-Xshare:off")) {
These flags should all immediately be rejected if used in a non-CDS build. Yes this is pre-existing but it now looks totally broken with the new changes. There should be something like:
#ifndef INCLUDE_CDS
} else if (match_option(option, "-Xshare")) { // or whatever we need to match the prefix only
warning("Option %s is not supported in this VM", option);
#else
// process flags as usual
#endif
-------------
PR: https://git.openjdk.org/jdk/pull/12691
More information about the hotspot-dev
mailing list