< prev index next >

src/share/vm/runtime/sharedRuntime.cpp

Print this page




 741 
 742 JRT_ENTRY(void, SharedRuntime::throw_NullPointerException(JavaThread* thread))
 743   throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_NullPointerException());
 744 JRT_END
 745 
 746 JRT_ENTRY(void, SharedRuntime::throw_NullPointerException_at_call(JavaThread* thread))
 747   // This entry point is effectively only used for NullPointerExceptions which occur at inline
 748   // cache sites (when the callee activation is not yet set up) so we are at a call site
 749   throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_NullPointerException());
 750 JRT_END
 751 
 752 JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread))
 753   // We avoid using the normal exception construction in this case because
 754   // it performs an upcall to Java, and we're already out of stack space.
 755   Klass* k = SystemDictionary::StackOverflowError_klass();
 756   oop exception_oop = InstanceKlass::cast(k)->allocate_instance(CHECK);
 757   Handle exception (thread, exception_oop);
 758   if (StackTraceInThrowable) {
 759     java_lang_Throwable::fill_in_stack_trace(exception);
 760   }


 761   throw_and_post_jvmti_exception(thread, exception);
 762 JRT_END
 763 
 764 address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread,
 765                                                            address pc,
 766                                                            SharedRuntime::ImplicitExceptionKind exception_kind)
 767 {
 768   address target_pc = NULL;
 769 
 770   if (Interpreter::contains(pc)) {
 771 #ifdef CC_INTERP
 772     // C++ interpreter doesn't throw implicit exceptions
 773     ShouldNotReachHere();
 774 #else
 775     switch (exception_kind) {
 776       case IMPLICIT_NULL:           return Interpreter::throw_NullPointerException_entry();
 777       case IMPLICIT_DIVIDE_BY_ZERO: return Interpreter::throw_ArithmeticException_entry();
 778       case STACK_OVERFLOW:          return Interpreter::throw_StackOverflowError_entry();
 779       default:                      ShouldNotReachHere();
 780     }




 741 
 742 JRT_ENTRY(void, SharedRuntime::throw_NullPointerException(JavaThread* thread))
 743   throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_NullPointerException());
 744 JRT_END
 745 
 746 JRT_ENTRY(void, SharedRuntime::throw_NullPointerException_at_call(JavaThread* thread))
 747   // This entry point is effectively only used for NullPointerExceptions which occur at inline
 748   // cache sites (when the callee activation is not yet set up) so we are at a call site
 749   throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_NullPointerException());
 750 JRT_END
 751 
 752 JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread))
 753   // We avoid using the normal exception construction in this case because
 754   // it performs an upcall to Java, and we're already out of stack space.
 755   Klass* k = SystemDictionary::StackOverflowError_klass();
 756   oop exception_oop = InstanceKlass::cast(k)->allocate_instance(CHECK);
 757   Handle exception (thread, exception_oop);
 758   if (StackTraceInThrowable) {
 759     java_lang_Throwable::fill_in_stack_trace(exception);
 760   }
 761   // Increment counter for hs_err file reporting
 762   Atomic::inc(&Exceptions::_stack_overflow_errors);
 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     }


< prev index next >