385 stub = SharedRuntime::get_poll_stub(pc);
386 } else if (sig == SIGBUS) {
387 // BugId 4454115: A read from a MappedByteBuffer can fault
388 // here if the underlying file has been truncated.
389 // Do not crash the VM in such a case.
390 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
391 CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
392 if (nm != NULL && nm->has_unsafe_access()) {
393 unsafe_access = true;
394 }
395 } else if (sig == SIGSEGV && !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
396 // Determination of interpreter/vtable stub/compiled code null exception
397 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
398 if (cb != NULL) {
399 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
400 }
401 } else if (sig == SIGILL && *(int *)pc == NativeInstruction::zombie_illegal_instruction) {
402 // Zombie
403 stub = SharedRuntime::get_handle_wrong_method_stub();
404 }
405 } else if (thread->thread_state() == _thread_in_vm &&
406 sig == SIGBUS && thread->doing_unsafe_access()) {
407 unsafe_access = true;
408 }
409
410 // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
411 // and the heap gets shrunk before the field access.
412 if (sig == SIGSEGV || sig == SIGBUS) {
413 address addr = JNI_FastGetField::find_slowcase_pc(pc);
414 if (addr != (address)-1) {
415 stub = addr;
416 }
417 }
418
419 // Check to see if we caught the safepoint code in the
420 // process of write protecting the memory serialization page.
421 // It write enables the page immediately after protecting it
422 // so we can just return to retry the write.
423 if (sig == SIGSEGV && os::is_memory_serialize_page(thread, (address) info->si_addr)) {
424 // Block current thread until the memory serialize page permission restored.
425 os::block_on_serialize_page_trap();
426 return true;
|
385 stub = SharedRuntime::get_poll_stub(pc);
386 } else if (sig == SIGBUS) {
387 // BugId 4454115: A read from a MappedByteBuffer can fault
388 // here if the underlying file has been truncated.
389 // Do not crash the VM in such a case.
390 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
391 CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
392 if (nm != NULL && nm->has_unsafe_access()) {
393 unsafe_access = true;
394 }
395 } else if (sig == SIGSEGV && !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
396 // Determination of interpreter/vtable stub/compiled code null exception
397 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
398 if (cb != NULL) {
399 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
400 }
401 } else if (sig == SIGILL && *(int *)pc == NativeInstruction::zombie_illegal_instruction) {
402 // Zombie
403 stub = SharedRuntime::get_handle_wrong_method_stub();
404 }
405 } else if (sig == SIGBUS && thread->doing_unsafe_access()) {
406 unsafe_access = true;
407 }
408
409 // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
410 // and the heap gets shrunk before the field access.
411 if (sig == SIGSEGV || sig == SIGBUS) {
412 address addr = JNI_FastGetField::find_slowcase_pc(pc);
413 if (addr != (address)-1) {
414 stub = addr;
415 }
416 }
417
418 // Check to see if we caught the safepoint code in the
419 // process of write protecting the memory serialization page.
420 // It write enables the page immediately after protecting it
421 // so we can just return to retry the write.
422 if (sig == SIGSEGV && os::is_memory_serialize_page(thread, (address) info->si_addr)) {
423 // Block current thread until the memory serialize page permission restored.
424 os::block_on_serialize_page_trap();
425 return true;
|