hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
changeset 38209 b2a58604e046
parent 38190 ff9ac612c723
child 38931 3cf28d630349
equal deleted inserted replaced
38208:ff63d43b0480 38209:b2a58604e046
   364         // BugId 4454115: A read from a MappedByteBuffer can fault here if the
   364         // BugId 4454115: A read from a MappedByteBuffer can fault here if the
   365         // underlying file has been truncated. Do not crash the VM in such a case.
   365         // underlying file has been truncated. Do not crash the VM in such a case.
   366         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   366         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   367         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
   367         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
   368         if (nm != NULL && nm->has_unsafe_access()) {
   368         if (nm != NULL && nm->has_unsafe_access()) {
   369           // We don't really need a stub here! Just set the pending exeption and
   369           address next_pc = pc + 4;
   370           // continue at the next instruction after the faulting read. Returning
   370           next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc);
   371           // garbage from this read is ok.
   371           os::Linux::ucontext_set_pc(uc, next_pc);
   372           thread->set_pending_unsafe_access_error();
       
   373           os::Linux::ucontext_set_pc(uc, pc + 4);
       
   374           return true;
   372           return true;
   375         }
   373         }
   376       }
   374       }
   377     }
   375     }
   378 
   376 
   383                         // flushing of icache is not necessary.
   381                         // flushing of icache is not necessary.
   384         stub = pc + 4;  // continue with next instruction.
   382         stub = pc + 4;  // continue with next instruction.
   385       }
   383       }
   386       else if (thread->thread_state() == _thread_in_vm &&
   384       else if (thread->thread_state() == _thread_in_vm &&
   387                sig == SIGBUS && thread->doing_unsafe_access()) {
   385                sig == SIGBUS && thread->doing_unsafe_access()) {
   388         // We don't really need a stub here! Just set the pending exeption and
   386         address next_pc = pc + 4;
   389         // continue at the next instruction after the faulting read. Returning
   387         next_pc = SharedRuntime::handle_unsafe_access(thread, next_pc);
   390         // garbage from this read is ok.
       
   391         thread->set_pending_unsafe_access_error();
       
   392         os::Linux::ucontext_set_pc(uc, pc + 4);
   388         os::Linux::ucontext_set_pc(uc, pc + 4);
   393         return true;
   389         return true;
   394       }
   390       }
   395     }
   391     }
   396 
   392