8209598: Clean up how messages are printed when CDS aborts start-up

Added a new function vm_exit_during_cds_dumping() to java.cpp so that it can be used when an error condition is encountered during CDS dumping.

Reviewed-by: iklam, dholmes, jiangli
This commit is contained in:
Calvin Cheung 2018-10-25 21:40:17 -07:00
parent 8dbea74827
commit 7c81535d46
6 changed files with 37 additions and 18 deletions

View file

@ -609,6 +609,26 @@ void vm_abort(bool dump_core) {
ShouldNotReachHere();
}
void vm_notify_during_cds_dumping(const char* error, const char* message) {
if (error != NULL) {
tty->print_cr("Error occurred during CDS dumping");
tty->print("%s", error);
if (message != NULL) {
tty->print_cr(": %s", message);
}
else {
tty->cr();
}
}
}
void vm_exit_during_cds_dumping(const char* error, const char* message) {
vm_notify_during_cds_dumping(error, message);
// Failure during CDS dumping, we don't want to dump core
vm_abort(false);
}
void vm_notify_during_shutdown(const char* error, const char* message) {
if (error != NULL) {
tty->print_cr("Error occurred during initialization of VM");