comparison src/share/vm/runtime/sharedRuntime.cpp @ 5111:422c979ff392

fixed two cases where DeoptAction was invalid
author Christian Haeubl <christian.haeubl@oracle.com>
date Thu, 15 Mar 2012 16:34:31 -0700
parents 0ebca2e35ca5
children 837a304d0ca8
comparison
equal deleted inserted replaced
5110:0ebca2e35ca5 5111:422c979ff392
787 java_lang_Throwable::fill_in_stack_trace(exception); 787 java_lang_Throwable::fill_in_stack_trace(exception);
788 } 788 }
789 throw_and_post_jvmti_exception(thread, exception); 789 throw_and_post_jvmti_exception(thread, exception);
790 JRT_END 790 JRT_END
791 791
792 address SharedRuntime::deoptimization_continuation(JavaThread* thread, address pc, nmethod* nm) 792 address SharedRuntime::deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason) {
793 { 793 assert(deopt_reason > Deoptimization::Reason_none && deopt_reason < Deoptimization::Reason_LIMIT, "invalid deopt reason");
794 if (TraceSignals) { 794 if (TraceSignals) {
795 tty->print_cr(err_msg("Deoptimizing on implicit exception at relative pc=%d in method %s", pc - nm->entry_point(), nm->method()->name()->as_C_string())); 795 tty->print_cr(err_msg("Deoptimizing on implicit exception at relative pc=%d in method %s", pc - nm->entry_point(), nm->method()->name()->as_C_string()));
796 } 796 }
797 thread->_ScratchA = (intptr_t)pc; 797 thread->_ScratchA = (intptr_t)pc;
798 return (SharedRuntime::deopt_blob()->jmp_uncommon_trap()); 798 thread->_ScratchB = Deoptimization::make_trap_request((Deoptimization::DeoptReason)deopt_reason, Deoptimization::Action_reinterpret);
799 return (SharedRuntime::deopt_blob()->implicit_exception_uncommon_trap());
799 } 800 }
800 801
801 JRT_ENTRY(void, SharedRuntime::throw_WrongMethodTypeException(JavaThread* thread, oopDesc* required, oopDesc* actual)) 802 JRT_ENTRY(void, SharedRuntime::throw_WrongMethodTypeException(JavaThread* thread, oopDesc* required, oopDesc* actual))
802 assert(thread == JavaThread::current() && required->is_oop() && actual->is_oop(), "bad args"); 803 assert(thread == JavaThread::current() && required->is_oop() && actual->is_oop(), "bad args");
803 ResourceMark rm; 804 ResourceMark rm;
889 890
890 #ifndef PRODUCT 891 #ifndef PRODUCT
891 _implicit_null_throws++; 892 _implicit_null_throws++;
892 #endif 893 #endif
893 #ifdef GRAAL 894 #ifdef GRAAL
894 target_pc = deoptimization_continuation(thread, pc, nm); 895 target_pc = deoptimize_for_implicit_exception(thread, pc, nm, Deoptimization::Reason_null_check);
895 #else 896 #else
896 target_pc = nm->continuation_for_implicit_exception(pc); 897 target_pc = nm->continuation_for_implicit_exception(pc);
897 #endif 898 #endif
898 // If there's an unexpected fault, target_pc might be NULL, 899 // If there's an unexpected fault, target_pc might be NULL,
899 // in which case we want to fall through into the normal 900 // in which case we want to fall through into the normal
912 #endif 913 #endif
913 #ifdef GRAAL 914 #ifdef GRAAL
914 if (TraceSignals) { 915 if (TraceSignals) {
915 tty->print_cr("graal implicit div0"); 916 tty->print_cr("graal implicit div0");
916 } 917 }
917 target_pc = deoptimization_continuation(thread, pc, nm); 918 target_pc = deoptimize_for_implicit_exception(thread, pc, nm, Deoptimization::Reason_div0_check);
918 #else 919 #else
919 target_pc = nm->continuation_for_implicit_exception(pc); 920 target_pc = nm->continuation_for_implicit_exception(pc);
920 #endif 921 #endif
921 // If there's an unexpected fault, target_pc might be NULL, 922 // If there's an unexpected fault, target_pc might be NULL,
922 // in which case we want to fall through into the normal 923 // in which case we want to fall through into the normal