Fri, 18 Jan 2019 11:05:23 +0800
#8027 Receiving SIGBUS does not correctly jump to the next instruction triggering this signal.
Reviewed-by: aoqi
src/cpu/mips/vm/stubGenerator_mips_64.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cpu/mips/vm/stubGenerator_mips_64.cpp Fri Jan 18 16:12:54 2019 +0800 1.2 +++ b/src/cpu/mips/vm/stubGenerator_mips_64.cpp Fri Jan 18 11:05:23 2019 +0800 1.3 @@ -69,7 +69,7 @@ 1.4 // pc is the instruction which we must emulate 1.5 // doing a no-op is fine: return garbage from the load 1.6 // therefore, compute npc 1.7 - address npc = (address)((unsigned long)pc + sizeof(unsigned long)); 1.8 + address npc = (address)((unsigned long)pc + sizeof(unsigned int)); 1.9 1.10 // request an async exception 1.11 thread->set_pending_unsafe_access_error(); 1.12 @@ -468,12 +468,14 @@ 1.13 address generate_handler_for_unsafe_access() { 1.14 StubCodeMark mark(this, "StubRoutines", "handler_for_unsafe_access"); 1.15 address start = __ pc(); 1.16 - __ pushad(); // push registers 1.17 + __ push(V0); 1.18 + __ pushad_except_v0(); // push registers 1.19 // Address next_pc(esp, RegisterImpl::number_of_registers * BytesPerWord); 1.20 __ call(CAST_FROM_FN_PTR(address, handle_unsafe_access), relocInfo::runtime_call_type); 1.21 __ delayed()->nop(); 1.22 - __ sw(V0, SP, RegisterImpl::number_of_registers * BytesPerWord); 1.23 - __ popad(); 1.24 + __ popad_except_v0(); 1.25 + __ move(RA, V0); 1.26 + __ pop(V0); 1.27 __ jr(RA); 1.28 __ delayed()->nop(); 1.29 return start;