746 JRT_END 747 748 JRT_ENTRY(void, SharedRuntime::throw_NullPointerException_at_call(JavaThread* thread)) 749 // This entry point is effectively only used for NullPointerExceptions which occur at inline 750 // cache sites (when the callee activation is not yet set up) so we are at a call site 751 throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_NullPointerException()); 752 JRT_END 753 754 JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread)) 755 // We avoid using the normal exception construction in this case because 756 // it performs an upcall to Java, and we're already out of stack space. 757 klassOop k = SystemDictionary::StackOverflowError_klass(); 758 oop exception_oop = instanceKlass::cast(k)->allocate_instance(CHECK); 759 Handle exception (thread, exception_oop); 760 if (StackTraceInThrowable) { 761 java_lang_Throwable::fill_in_stack_trace(exception); 762 } 763 throw_and_post_jvmti_exception(thread, exception); 764 JRT_END 765 766 address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread, 767 address pc, 768 SharedRuntime::ImplicitExceptionKind exception_kind) 769 { 770 address target_pc = NULL; 771 772 if (Interpreter::contains(pc)) { 773 #ifdef CC_INTERP 774 // C++ interpreter doesn't throw implicit exceptions 775 ShouldNotReachHere(); 776 #else 777 switch (exception_kind) { 778 case IMPLICIT_NULL: return Interpreter::throw_NullPointerException_entry(); 779 case IMPLICIT_DIVIDE_BY_ZERO: return Interpreter::throw_ArithmeticException_entry(); 780 case STACK_OVERFLOW: return Interpreter::throw_StackOverflowError_entry(); 781 default: ShouldNotReachHere(); 782 } 783 #endif // !CC_INTERP 784 } else { 785 switch (exception_kind) { | 746 JRT_END 747 748 JRT_ENTRY(void, SharedRuntime::throw_NullPointerException_at_call(JavaThread* thread)) 749 // This entry point is effectively only used for NullPointerExceptions which occur at inline 750 // cache sites (when the callee activation is not yet set up) so we are at a call site 751 throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_NullPointerException()); 752 JRT_END 753 754 JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread)) 755 // We avoid using the normal exception construction in this case because 756 // it performs an upcall to Java, and we're already out of stack space. 757 klassOop k = SystemDictionary::StackOverflowError_klass(); 758 oop exception_oop = instanceKlass::cast(k)->allocate_instance(CHECK); 759 Handle exception (thread, exception_oop); 760 if (StackTraceInThrowable) { 761 java_lang_Throwable::fill_in_stack_trace(exception); 762 } 763 throw_and_post_jvmti_exception(thread, exception); 764 JRT_END 765 766 JRT_ENTRY(void, SharedRuntime::throw_WrongMethodTypeException(JavaThread* thread, oopDesc* required, oopDesc* actual)) 767 assert(thread == JavaThread::current() && required->is_oop() && actual->is_oop(), "bad args"); 768 ResourceMark rm; 769 char* message = SharedRuntime::generate_wrong_method_type_message(thread, required, actual); 770 throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_invoke_WrongMethodTypeException(), message); 771 JRT_END 772 773 address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread, 774 address pc, 775 SharedRuntime::ImplicitExceptionKind exception_kind) 776 { 777 address target_pc = NULL; 778 779 if (Interpreter::contains(pc)) { 780 #ifdef CC_INTERP 781 // C++ interpreter doesn't throw implicit exceptions 782 ShouldNotReachHere(); 783 #else 784 switch (exception_kind) { 785 case IMPLICIT_NULL: return Interpreter::throw_NullPointerException_entry(); 786 case IMPLICIT_DIVIDE_BY_ZERO: return Interpreter::throw_ArithmeticException_entry(); 787 case STACK_OVERFLOW: return Interpreter::throw_StackOverflowError_entry(); 788 default: ShouldNotReachHere(); 789 } 790 #endif // !CC_INTERP 791 } else { 792 switch (exception_kind) { |