hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
changeset 38209 b2a58604e046
parent 38190 ff9ac612c723
child 40010 e32d5e545789
equal deleted inserted replaced
38208:ff63d43b0480 38209:b2a58604e046
   431     return true;
   431     return true;
   432   }
   432   }
   433   return false;
   433   return false;
   434 }
   434 }
   435 
   435 
   436 inline static bool checkByteBuffer(address pc, address* stub) {
   436 inline static bool checkByteBuffer(address pc, address npc, address* stub) {
   437   // BugId 4454115: A read from a MappedByteBuffer can fault
   437   // BugId 4454115: A read from a MappedByteBuffer can fault
   438   // here if the underlying file has been truncated.
   438   // here if the underlying file has been truncated.
   439   // Do not crash the VM in such a case.
   439   // Do not crash the VM in such a case.
   440   CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   440   CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   441   CompiledMethod* nm = cb->as_compiled_method_or_null();
   441   CompiledMethod* nm = cb->as_compiled_method_or_null();
   442   if (nm != NULL && nm->has_unsafe_access()) {
   442   if (nm != NULL && nm->has_unsafe_access()) {
   443     *stub = StubRoutines::handler_for_unsafe_access();
   443     *stub = SharedRuntime::handle_unsafe_access(thread, npc);
   444     return true;
   444     return true;
   445   }
   445   }
   446   return false;
   446   return false;
   447 }
   447 }
   448 
   448 
   611     }
   611     }
   612 
   612 
   613     if (sig == SIGBUS &&
   613     if (sig == SIGBUS &&
   614         thread->thread_state() == _thread_in_vm &&
   614         thread->thread_state() == _thread_in_vm &&
   615         thread->doing_unsafe_access()) {
   615         thread->doing_unsafe_access()) {
   616       stub = StubRoutines::handler_for_unsafe_access();
   616       stub = SharedRuntime::handle_unsafe_access(thread, npc);
   617     }
   617     }
   618 
   618 
   619     if (thread->thread_state() == _thread_in_Java) {
   619     if (thread->thread_state() == _thread_in_Java) {
   620       do {
   620       do {
   621         // Java thread running in Java code => find exception handler if any
   621         // Java thread running in Java code => find exception handler if any
   623 
   623 
   624         if ((sig == SIGSEGV) && checkPollingPage(pc, (address)info->si_addr, &stub)) {
   624         if ((sig == SIGSEGV) && checkPollingPage(pc, (address)info->si_addr, &stub)) {
   625           break;
   625           break;
   626         }
   626         }
   627 
   627 
   628         if ((sig == SIGBUS) && checkByteBuffer(pc, &stub)) {
   628         if ((sig == SIGBUS) && checkByteBuffer(pc, npc, &stub)) {
   629           break;
   629           break;
   630         }
   630         }
   631 
   631 
   632         if ((sig == SIGSEGV || sig == SIGBUS) &&
   632         if ((sig == SIGSEGV || sig == SIGBUS) &&
   633             checkVerifyOops(pc, (address)info->si_addr, &stub)) {
   633             checkVerifyOops(pc, (address)info->si_addr, &stub)) {