mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8171011: convert some CDS dump time warning and error messages to informational messages which will be printed with -XX:+PrintSharedSpaces
Print informational message if a module related options is used during dumping except for the -m option Reviewed-by: iklam, jiangli, mseledtsov
This commit is contained in:
parent
973b6f24d0
commit
026a05429c
1 changed files with 10 additions and 7 deletions
|
@ -1327,26 +1327,29 @@ void Arguments::check_unsupported_dumping_properties() {
|
||||||
"jdk.module.addmods.0",
|
"jdk.module.addmods.0",
|
||||||
"jdk.module.patch.0" };
|
"jdk.module.patch.0" };
|
||||||
const char* unsupported_options[] = { "-m", // cannot use at dump time
|
const char* unsupported_options[] = { "-m", // cannot use at dump time
|
||||||
"--limit-modules", // cannot use at dump time
|
"--limit-modules", // ignored at dump time
|
||||||
"--module-path", // ignored at dump time
|
"--module-path", // ignored at dump time
|
||||||
"--upgrade-module-path", // ignored at dump time
|
"--upgrade-module-path", // ignored at dump time
|
||||||
"--add-modules", // ignored at dump time
|
"--add-modules", // ignored at dump time
|
||||||
"--patch-module" // ignored at dump time
|
"--patch-module" // ignored at dump time
|
||||||
};
|
};
|
||||||
assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
|
assert(ARRAY_SIZE(unsupported_properties) == ARRAY_SIZE(unsupported_options), "must be");
|
||||||
// If a vm option is found in the unsupported_options array with index less than the warning_idx,
|
// If a vm option is found in the unsupported_options array with index less than the info_idx,
|
||||||
// vm will exit with an error message. Otherwise, it will result in a warning message.
|
// vm will exit with an error message. Otherwise, it will print an informational message if
|
||||||
uint warning_idx = 2;
|
// PrintSharedSpaces is enabled.
|
||||||
|
uint info_idx = 1;
|
||||||
SystemProperty* sp = system_properties();
|
SystemProperty* sp = system_properties();
|
||||||
while (sp != NULL) {
|
while (sp != NULL) {
|
||||||
for (uint i = 0; i < ARRAY_SIZE(unsupported_properties); i++) {
|
for (uint i = 0; i < ARRAY_SIZE(unsupported_properties); i++) {
|
||||||
if (strcmp(sp->key(), unsupported_properties[i]) == 0) {
|
if (strcmp(sp->key(), unsupported_properties[i]) == 0) {
|
||||||
if (i < warning_idx) {
|
if (i < info_idx) {
|
||||||
vm_exit_during_initialization(
|
vm_exit_during_initialization(
|
||||||
"Cannot use the following option when dumping the shared archive", unsupported_options[i]);
|
"Cannot use the following option when dumping the shared archive", unsupported_options[i]);
|
||||||
} else {
|
} else {
|
||||||
warning(
|
if (PrintSharedSpaces) {
|
||||||
"the %s option is ignored when dumping the shared archive", unsupported_options[i]);
|
tty->print_cr(
|
||||||
|
"Info: the %s option is ignored when dumping the shared archive", unsupported_options[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue