590 guarantee(cb->is_adapter_blob(), 591 "exception happened outside interpreter, nmethods and vtable stubs (1)"); 592 // There is no handler here, so we will simply unwind. 593 return StubRoutines::throw_NullPointerException_at_call_entry(); 594 } 595 596 // Otherwise, it's an nmethod. Consult its exception handlers. 597 nmethod* nm = (nmethod*)cb; 598 if (nm->inlinecache_check_contains(pc)) { 599 // exception happened inside inline-cache check code 600 // => the nmethod is not yet active (i.e., the frame 601 // is not set up yet) => use return address pushed by 602 // caller => don't push another return address 603 return StubRoutines::throw_NullPointerException_at_call_entry(); 604 } 605 606 #ifndef PRODUCT 607 _implicit_null_throws++; 608 #endif 609 target_pc = nm->continuation_for_implicit_exception(pc); 610 guarantee(target_pc != 0, "must have a continuation point"); 611 } 612 613 break; // fall through 614 } 615 616 617 case IMPLICIT_DIVIDE_BY_ZERO: { 618 nmethod* nm = CodeCache::find_nmethod(pc); 619 guarantee(nm != NULL, "must have containing nmethod for implicit division-by-zero exceptions"); 620 #ifndef PRODUCT 621 _implicit_div0_throws++; 622 #endif 623 target_pc = nm->continuation_for_implicit_exception(pc); 624 guarantee(target_pc != 0, "must have a continuation point"); 625 break; // fall through 626 } 627 628 default: ShouldNotReachHere(); 629 } 630 631 guarantee(target_pc != NULL, "must have computed destination PC for implicit exception"); 632 assert(exception_kind == IMPLICIT_NULL || exception_kind == IMPLICIT_DIVIDE_BY_ZERO, "wrong implicit exception kind"); 633 634 // for AbortVMOnException flag 635 NOT_PRODUCT(Exceptions::debug_check_abort("java.lang.NullPointerException")); 636 if (exception_kind == IMPLICIT_NULL) { 637 Events::log("Implicit null exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc); 638 } else { 639 Events::log("Implicit division by zero exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc); 640 } 641 return target_pc; 642 } 643 644 ShouldNotReachHere(); 645 return NULL; 646 } 647 648 649 JNI_ENTRY(void, throw_unsatisfied_link_error(JNIEnv* env, ...)) 650 { 651 THROW(vmSymbols::java_lang_UnsatisfiedLinkError()); | 590 guarantee(cb->is_adapter_blob(), 591 "exception happened outside interpreter, nmethods and vtable stubs (1)"); 592 // There is no handler here, so we will simply unwind. 593 return StubRoutines::throw_NullPointerException_at_call_entry(); 594 } 595 596 // Otherwise, it's an nmethod. Consult its exception handlers. 597 nmethod* nm = (nmethod*)cb; 598 if (nm->inlinecache_check_contains(pc)) { 599 // exception happened inside inline-cache check code 600 // => the nmethod is not yet active (i.e., the frame 601 // is not set up yet) => use return address pushed by 602 // caller => don't push another return address 603 return StubRoutines::throw_NullPointerException_at_call_entry(); 604 } 605 606 #ifndef PRODUCT 607 _implicit_null_throws++; 608 #endif 609 target_pc = nm->continuation_for_implicit_exception(pc); 610 // If there's an unexpected fault, target_pc might be NULL, 611 // in which case we want to fall through into the normal 612 // error handling code. 613 } 614 615 break; // fall through 616 } 617 618 619 case IMPLICIT_DIVIDE_BY_ZERO: { 620 nmethod* nm = CodeCache::find_nmethod(pc); 621 guarantee(nm != NULL, "must have containing nmethod for implicit division-by-zero exceptions"); 622 #ifndef PRODUCT 623 _implicit_div0_throws++; 624 #endif 625 target_pc = nm->continuation_for_implicit_exception(pc); 626 // If there's an unexpected fault, target_pc might be NULL, 627 // in which case we want to fall through into the normal 628 // error handling code. 629 break; // fall through 630 } 631 632 default: ShouldNotReachHere(); 633 } 634 635 assert(exception_kind == IMPLICIT_NULL || exception_kind == IMPLICIT_DIVIDE_BY_ZERO, "wrong implicit exception kind"); 636 637 // for AbortVMOnException flag 638 NOT_PRODUCT(Exceptions::debug_check_abort("java.lang.NullPointerException")); 639 if (exception_kind == IMPLICIT_NULL) { 640 Events::log("Implicit null exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc); 641 } else { 642 Events::log("Implicit division by zero exception at " INTPTR_FORMAT " to " INTPTR_FORMAT, pc, target_pc); 643 } 644 return target_pc; 645 } 646 647 ShouldNotReachHere(); 648 return NULL; 649 } 650 651 652 JNI_ENTRY(void, throw_unsatisfied_link_error(JNIEnv* env, ...)) 653 { 654 THROW(vmSymbols::java_lang_UnsatisfiedLinkError()); |