src/share/vm/runtime/sharedRuntime.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/runtime

src/share/vm/runtime/sharedRuntime.cpp

Print this page
rev 6086 : 8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
Summary: make compiled code bang the stack by the worst case size of the interpreter frame at deoptimization points.
Reviewed-by:


 758 
 759   if (Interpreter::contains(pc)) {
 760 #ifdef CC_INTERP
 761     // C++ interpreter doesn't throw implicit exceptions
 762     ShouldNotReachHere();
 763 #else
 764     switch (exception_kind) {
 765       case IMPLICIT_NULL:           return Interpreter::throw_NullPointerException_entry();
 766       case IMPLICIT_DIVIDE_BY_ZERO: return Interpreter::throw_ArithmeticException_entry();
 767       case STACK_OVERFLOW:          return Interpreter::throw_StackOverflowError_entry();
 768       default:                      ShouldNotReachHere();
 769     }
 770 #endif // !CC_INTERP
 771   } else {
 772     switch (exception_kind) {
 773       case STACK_OVERFLOW: {
 774         // Stack overflow only occurs upon frame setup; the callee is
 775         // going to be unwound. Dispatch to a shared runtime stub
 776         // which will cause the StackOverflowError to be fabricated
 777         // and processed.
 778         // For stack overflow in deoptimization blob, cleanup thread.
 779         if (thread->deopt_mark() != NULL) {
 780           Deoptimization::cleanup_deopt_info(thread, NULL);
 781         }



 782         Events::log_exception(thread, "StackOverflowError at " INTPTR_FORMAT, pc);
 783         return StubRoutines::throw_StackOverflowError_entry();
 784       }
 785 
 786       case IMPLICIT_NULL: {
 787         if (VtableStubs::contains(pc)) {
 788           // We haven't yet entered the callee frame. Fabricate an
 789           // exception and begin dispatching it in the caller. Since
 790           // the caller was at a call site, it's safe to destroy all
 791           // caller-saved registers, as these entry points do.
 792           VtableStub* vt_stub = VtableStubs::stub_containing(pc);
 793 
 794           // If vt_stub is NULL, then return NULL to signal handler to report the SEGV error.
 795           if (vt_stub == NULL) return NULL;
 796 
 797           if (vt_stub->is_abstract_method_error(pc)) {
 798             assert(!vt_stub->is_vtable_stub(), "should never see AbstractMethodErrors from vtable-type VtableStubs");
 799             Events::log_exception(thread, "AbstractMethodError at " INTPTR_FORMAT, pc);
 800             return StubRoutines::throw_AbstractMethodError_entry();
 801           } else {




 758 
 759   if (Interpreter::contains(pc)) {
 760 #ifdef CC_INTERP
 761     // C++ interpreter doesn't throw implicit exceptions
 762     ShouldNotReachHere();
 763 #else
 764     switch (exception_kind) {
 765       case IMPLICIT_NULL:           return Interpreter::throw_NullPointerException_entry();
 766       case IMPLICIT_DIVIDE_BY_ZERO: return Interpreter::throw_ArithmeticException_entry();
 767       case STACK_OVERFLOW:          return Interpreter::throw_StackOverflowError_entry();
 768       default:                      ShouldNotReachHere();
 769     }
 770 #endif // !CC_INTERP
 771   } else {
 772     switch (exception_kind) {
 773       case STACK_OVERFLOW: {
 774         // Stack overflow only occurs upon frame setup; the callee is
 775         // going to be unwound. Dispatch to a shared runtime stub
 776         // which will cause the StackOverflowError to be fabricated
 777         // and processed.
 778         // Stack overflow should never occur during deoptimization:
 779         // the compiled method bang the stack by as much as the
 780         // interpreter would need in case of a deoptimization. The
 781         // deoptimization blob and uncommon trap blob bang the stack
 782         // in a debug VM to verify the correctness of the compiled
 783         // method stack banging.
 784         assert(thread->deopt_mark() == NULL, "no stack overflow from deopt blob/uncommon trap");
 785         Events::log_exception(thread, "StackOverflowError at " INTPTR_FORMAT, pc);
 786         return StubRoutines::throw_StackOverflowError_entry();
 787       }
 788 
 789       case IMPLICIT_NULL: {
 790         if (VtableStubs::contains(pc)) {
 791           // We haven't yet entered the callee frame. Fabricate an
 792           // exception and begin dispatching it in the caller. Since
 793           // the caller was at a call site, it's safe to destroy all
 794           // caller-saved registers, as these entry points do.
 795           VtableStub* vt_stub = VtableStubs::stub_containing(pc);
 796 
 797           // If vt_stub is NULL, then return NULL to signal handler to report the SEGV error.
 798           if (vt_stub == NULL) return NULL;
 799 
 800           if (vt_stub->is_abstract_method_error(pc)) {
 801             assert(!vt_stub->is_vtable_stub(), "should never see AbstractMethodErrors from vtable-type VtableStubs");
 802             Events::log_exception(thread, "AbstractMethodError at " INTPTR_FORMAT, pc);
 803             return StubRoutines::throw_AbstractMethodError_entry();
 804           } else {


src/share/vm/runtime/sharedRuntime.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File