Skip to content

Commit 81104fd

Browse files
author
duke
committedJun 5, 2020
Automatic merge of jdk:master into master
2 parents 948699a + 5f0f4d7 commit 81104fd

File tree

5 files changed

+47
-33
lines changed

5 files changed

+47
-33
lines changed
 

‎src/hotspot/cpu/ppc/disassembler_ppc.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ void Disassembler::annotate(address here, outputStream* st) {
192192
st->fill_to(aligned_pos + tabspacing);
193193
st->print(";trap: ic miss check");
194194
} else if ((stop_type = MacroAssembler::tdi_get_si16(instruction, Assembler::traptoUnconditional, 0)) != -1) {
195+
bool msg_present = (stop_type & MacroAssembler::stop_msg_present);
196+
stop_type = (stop_type &~ MacroAssembler::stop_msg_present);
197+
const char **detail_msg_ptr = (const char**)(here + 4);
195198
st->fill_to(aligned_pos + tabspacing);
196-
st->print(";trap: stop type %d", stop_type);
199+
st->print(";trap: stop type %d: %s", stop_type, msg_present ? *detail_msg_ptr : "no details provided");
197200
}
198201
}

‎src/hotspot/cpu/ppc/macroAssembler_ppc.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -4432,17 +4432,21 @@ void MacroAssembler::verify_oop_addr(RegisterOrConstant offs, Register base, con
44324432

44334433
// Call a C-function that prints output.
44344434
void MacroAssembler::stop(int type, const char* msg) {
4435+
bool msg_present = (msg != NULL);
4436+
44354437
#ifndef PRODUCT
4436-
block_comment(err_msg("stop(type %d): %s {", type, msg));
4438+
block_comment(err_msg("stop(type %d): %s {", type, msg_present ? msg : "null"));
44374439
#else
44384440
block_comment("stop {");
44394441
#endif
44404442

4441-
if (type != stop_shouldnotreachhere) {
4442-
// Use R0 to pass msg. "shouldnotreachhere" preserves R0.
4443-
load_const_optimized(R0, (void*)msg);
4443+
if (msg_present) {
4444+
type |= stop_msg_present;
44444445
}
44454446
tdi_unchecked(traptoUnconditional, 0/*reg 0*/, type);
4447+
if (msg_present) {
4448+
emit_int64((uintptr_t)msg);
4449+
}
44464450

44474451
block_comment("} stop;");
44484452
}

‎src/hotspot/cpu/ppc/macroAssembler_ppc.hpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -901,17 +901,18 @@ class MacroAssembler: public Assembler {
901901

902902
public:
903903
enum {
904-
stop_stop = 0,
905-
stop_untested = 1,
906-
stop_unimplemented = 2,
907-
stop_shouldnotreachhere = 3
904+
stop_stop = 0,
905+
stop_untested = 1,
906+
stop_unimplemented = 2,
907+
stop_shouldnotreachhere = 3,
908+
stop_msg_present = -0x8000
908909
};
909910

910911
// Prints msg, dumps registers and stops execution.
911-
void stop (const char* msg = NULL) { stop(stop_stop, msg ); }
912-
void untested (const char* msg = NULL) { stop(stop_untested, msg ); }
913-
void unimplemented(const char* msg = NULL) { stop(stop_unimplemented, msg ); }
914-
void should_not_reach_here() { stop(stop_shouldnotreachhere, NULL); }
912+
void stop (const char* msg = NULL) { stop(stop_stop, msg); }
913+
void untested (const char* msg = NULL) { stop(stop_untested, msg); }
914+
void unimplemented (const char* msg = NULL) { stop(stop_unimplemented, msg); }
915+
void should_not_reach_here(const char* msg = NULL) { stop(stop_shouldnotreachhere, msg); }
915916

916917
void zap_from_to(Register low, int before, Register high, int after, Register val, Register addr) PRODUCT_RETURN;
917918
};

‎src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp

+13-10
Original file line numberDiff line numberDiff line change
@@ -438,25 +438,28 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
438438

439439
// stop on request
440440
else if (sig == SIGTRAP && (stop_type = nativeInstruction_at(pc)->get_stop_type()) != -1) {
441-
const char *msg = NULL,
442-
*detail_msg = (const char*)(uc->uc_mcontext.jmp_context.gpr[0]);
441+
bool msg_present = (stop_type & MacroAssembler::stop_msg_present);
442+
stop_type = (stop_type &~ MacroAssembler::stop_msg_present);
443+
444+
const char *msg = NULL;
443445
switch (stop_type) {
444-
case MacroAssembler::stop_stop : msg = "stop"; break;
445-
case MacroAssembler::stop_untested : msg = "untested"; break;
446-
case MacroAssembler::stop_unimplemented : msg = "unimplemented"; break;
447-
case MacroAssembler::stop_shouldnotreachhere: msg = "shouldnotreachhere"; detail_msg = NULL; break;
446+
case MacroAssembler::stop_stop : msg = "stop"; break;
447+
case MacroAssembler::stop_untested : msg = "untested"; break;
448+
case MacroAssembler::stop_unimplemented : msg = "unimplemented"; break;
449+
case MacroAssembler::stop_shouldnotreachhere: msg = "shouldnotreachhere"; break;
448450
default: msg = "unknown"; break;
449451
}
450-
if (detail_msg == NULL) {
451-
detail_msg = "no details provided";
452-
}
452+
453+
const char **detail_msg_ptr = (const char**)(pc + 4);
454+
const char *detail_msg = msg_present ? *detail_msg_ptr : "no details provided";
453455

454456
if (TraceTraps) {
455457
tty->print_cr("trap: %s: %s (SIGTRAP, stop type %d)", msg, detail_msg, stop_type);
456458
}
457459

458460
va_list detail_args;
459-
VMError::report_and_die(t, ucVoid, NULL, 0, msg, detail_msg, detail_args);
461+
VMError::report_and_die(INTERNAL_ERROR, msg, detail_msg, detail_args, thread,
462+
pc, info, ucVoid, NULL, 0, 0);
460463
va_end(detail_args);
461464
}
462465

‎src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp

+13-10
Original file line numberDiff line numberDiff line change
@@ -468,25 +468,28 @@ JVM_handle_linux_signal(int sig,
468468

469469
// stop on request
470470
else if (sig == SIGTRAP && (stop_type = nativeInstruction_at(pc)->get_stop_type()) != -1) {
471-
const char *msg = NULL,
472-
*detail_msg = (const char*)(uc->uc_mcontext.regs->gpr[0]);
471+
bool msg_present = (stop_type & MacroAssembler::stop_msg_present);
472+
stop_type = (stop_type &~ MacroAssembler::stop_msg_present);
473+
474+
const char *msg = NULL;
473475
switch (stop_type) {
474-
case MacroAssembler::stop_stop : msg = "stop"; break;
475-
case MacroAssembler::stop_untested : msg = "untested"; break;
476-
case MacroAssembler::stop_unimplemented : msg = "unimplemented"; break;
477-
case MacroAssembler::stop_shouldnotreachhere: msg = "shouldnotreachhere"; detail_msg = NULL; break;
476+
case MacroAssembler::stop_stop : msg = "stop"; break;
477+
case MacroAssembler::stop_untested : msg = "untested"; break;
478+
case MacroAssembler::stop_unimplemented : msg = "unimplemented"; break;
479+
case MacroAssembler::stop_shouldnotreachhere: msg = "shouldnotreachhere"; break;
478480
default: msg = "unknown"; break;
479481
}
480-
if (detail_msg == NULL) {
481-
detail_msg = "no details provided";
482-
}
482+
483+
const char **detail_msg_ptr = (const char**)(pc + 4);
484+
const char *detail_msg = msg_present ? *detail_msg_ptr : "no details provided";
483485

484486
if (TraceTraps) {
485487
tty->print_cr("trap: %s: %s (SIGTRAP, stop type %d)", msg, detail_msg, stop_type);
486488
}
487489

488490
va_list detail_args;
489-
VMError::report_and_die(t, ucVoid, NULL, 0, msg, detail_msg, detail_args);
491+
VMError::report_and_die(INTERNAL_ERROR, msg, detail_msg, detail_args, thread,
492+
pc, info, ucVoid, NULL, 0, 0);
490493
va_end(detail_args);
491494
}
492495

0 commit comments

Comments
 (0)
Please sign in to comment.