610 nmethod* nm = NULL;
611 address continuation = NULL;
612 {
613 // Enter VM mode by calling the helper
614 ResetNoHandleMark rnhm;
615 continuation = exception_handler_for_pc_helper(thread, exception, pc, nm);
616 }
617 // Back in JAVA, use no oops DON'T safepoint
618
619 // Now check to see if the nmethod we were called from is now deoptimized.
620 // If so we must return to the deopt blob and deoptimize the nmethod
621 if (nm != NULL && caller_is_deopted()) {
622 continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
623 }
624
625 assert(continuation != NULL, "no handler found");
626 return continuation;
627 }
628
629
630 JRT_ENTRY(void, Runtime1::throw_range_check_exception(JavaThread* thread, int index))
631 NOT_PRODUCT(_throw_range_check_exception_count++;)
632 char message[jintAsStringSize];
633 sprintf(message, "%d", index);
634 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message);
635 JRT_END
636
637
638 JRT_ENTRY(void, Runtime1::throw_index_exception(JavaThread* thread, int index))
639 NOT_PRODUCT(_throw_index_exception_count++;)
640 char message[16];
641 sprintf(message, "%d", index);
642 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IndexOutOfBoundsException(), message);
643 JRT_END
644
645
646 JRT_ENTRY(void, Runtime1::throw_div0_exception(JavaThread* thread))
647 NOT_PRODUCT(_throw_div0_exception_count++;)
648 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArithmeticException(), "/ by zero");
649 JRT_END
650
651
652 JRT_ENTRY(void, Runtime1::throw_null_pointer_exception(JavaThread* thread))
653 NOT_PRODUCT(_throw_null_pointer_exception_count++;)
|
610 nmethod* nm = NULL;
611 address continuation = NULL;
612 {
613 // Enter VM mode by calling the helper
614 ResetNoHandleMark rnhm;
615 continuation = exception_handler_for_pc_helper(thread, exception, pc, nm);
616 }
617 // Back in JAVA, use no oops DON'T safepoint
618
619 // Now check to see if the nmethod we were called from is now deoptimized.
620 // If so we must return to the deopt blob and deoptimize the nmethod
621 if (nm != NULL && caller_is_deopted()) {
622 continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
623 }
624
625 assert(continuation != NULL, "no handler found");
626 return continuation;
627 }
628
629
630 JRT_ENTRY(void, Runtime1::throw_range_check_exception(JavaThread* thread, int index, arrayOopDesc* a))
631 NOT_PRODUCT(_throw_range_check_exception_count++;)
632 const int len = 35;
633 assert(len < strlen("Index %d out-of-bounds for length %d."), "Must allocate more space for message.");
634 char message[2 * jintAsStringSize + len];
635 sprintf(message, "Index %d out-of-bounds for length %d.", index, a->length());
636 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message);
637 JRT_END
638
639
640 JRT_ENTRY(void, Runtime1::throw_index_exception(JavaThread* thread, int index))
641 NOT_PRODUCT(_throw_index_exception_count++;)
642 char message[16];
643 sprintf(message, "%d", index);
644 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IndexOutOfBoundsException(), message);
645 JRT_END
646
647
648 JRT_ENTRY(void, Runtime1::throw_div0_exception(JavaThread* thread))
649 NOT_PRODUCT(_throw_div0_exception_count++;)
650 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArithmeticException(), "/ by zero");
651 JRT_END
652
653
654 JRT_ENTRY(void, Runtime1::throw_null_pointer_exception(JavaThread* thread))
655 NOT_PRODUCT(_throw_null_pointer_exception_count++;)
|