399 warning("fixed up memory fault in +VerifyOops at address "
400 INTPTR_FORMAT, p2i(fault));
401 return true;
402 }
403 return false;
404 }
405
406 inline static bool checkFPFault(address pc, int code,
407 JavaThread* thread, address* stub) {
408 if (code == FPE_INTDIV || code == FPE_FLTDIV) {
409 *stub =
410 SharedRuntime::
411 continuation_for_implicit_exception(thread,
412 pc,
413 SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
414 return true;
415 }
416 return false;
417 }
418
419 inline static bool checkNullPointer(address pc, intptr_t fault,
420 JavaThread* thread, address* stub) {
421 if (!MacroAssembler::needs_explicit_null_check(fault)) {
422 // Determination of interpreter/vtable stub/compiled code null
423 // exception
424 *stub =
425 SharedRuntime::
426 continuation_for_implicit_exception(thread, pc,
427 SharedRuntime::IMPLICIT_NULL);
428 return true;
429 }
430 return false;
431 }
432
433 inline static bool checkFastJNIAccess(address pc, address* stub) {
434 address addr = JNI_FastGetField::find_slowcase_pc(pc);
435 if (addr != (address)-1) {
436 *stub = addr;
437 return true;
438 }
439 return false;
440 }
441
583 }
584
585 if ((sig == SIGSEGV || sig == SIGBUS) &&
586 checkVerifyOops(pc, (address)info->si_addr, &stub)) {
587 break;
588 }
589
590 if ((sig == SIGSEGV) && checkZombie(uc, &pc, &stub)) {
591 break;
592 }
593
594 if ((sig == SIGILL) && checkICMiss(uc, &pc, &stub)) {
595 break;
596 }
597
598 if ((sig == SIGFPE) && checkFPFault(pc, info->si_code, thread, &stub)) {
599 break;
600 }
601
602 if ((sig == SIGSEGV) &&
603 checkNullPointer(pc, (intptr_t)info->si_addr, thread, &stub)) {
604 break;
605 }
606 } while (0);
607
608 // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
609 // and the heap gets shrunk before the field access.
610 if ((sig == SIGSEGV) || (sig == SIGBUS)) {
611 checkFastJNIAccess(pc, &stub);
612 }
613 }
614
615 if (stub != NULL) {
616 // save all thread context in case we need to restore it
617 thread->set_saved_exception_pc(pc);
618 thread->set_saved_exception_npc(npc);
619 os::Linux::ucontext_set_pc((ucontext_t*)uc, stub);
620 return true;
621 }
622 }
623
|
399 warning("fixed up memory fault in +VerifyOops at address "
400 INTPTR_FORMAT, p2i(fault));
401 return true;
402 }
403 return false;
404 }
405
406 inline static bool checkFPFault(address pc, int code,
407 JavaThread* thread, address* stub) {
408 if (code == FPE_INTDIV || code == FPE_FLTDIV) {
409 *stub =
410 SharedRuntime::
411 continuation_for_implicit_exception(thread,
412 pc,
413 SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
414 return true;
415 }
416 return false;
417 }
418
419 inline static bool checkNullPointer(address pc, void* fault,
420 JavaThread* thread, address* stub) {
421 if (MacroAssembler::uses_implicit_null_check(fault)) {
422 // Determination of interpreter/vtable stub/compiled code null
423 // exception
424 *stub =
425 SharedRuntime::
426 continuation_for_implicit_exception(thread, pc,
427 SharedRuntime::IMPLICIT_NULL);
428 return true;
429 }
430 return false;
431 }
432
433 inline static bool checkFastJNIAccess(address pc, address* stub) {
434 address addr = JNI_FastGetField::find_slowcase_pc(pc);
435 if (addr != (address)-1) {
436 *stub = addr;
437 return true;
438 }
439 return false;
440 }
441
583 }
584
585 if ((sig == SIGSEGV || sig == SIGBUS) &&
586 checkVerifyOops(pc, (address)info->si_addr, &stub)) {
587 break;
588 }
589
590 if ((sig == SIGSEGV) && checkZombie(uc, &pc, &stub)) {
591 break;
592 }
593
594 if ((sig == SIGILL) && checkICMiss(uc, &pc, &stub)) {
595 break;
596 }
597
598 if ((sig == SIGFPE) && checkFPFault(pc, info->si_code, thread, &stub)) {
599 break;
600 }
601
602 if ((sig == SIGSEGV) &&
603 checkNullPointer(pc, info->si_addr, thread, &stub)) {
604 break;
605 }
606 } while (0);
607
608 // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
609 // and the heap gets shrunk before the field access.
610 if ((sig == SIGSEGV) || (sig == SIGBUS)) {
611 checkFastJNIAccess(pc, &stub);
612 }
613 }
614
615 if (stub != NULL) {
616 // save all thread context in case we need to restore it
617 thread->set_saved_exception_pc(pc);
618 thread->set_saved_exception_npc(npc);
619 os::Linux::ucontext_set_pc((ucontext_t*)uc, stub);
620 return true;
621 }
622 }
623
|