< prev index next >

src/hotspot/share/c1/c1_Runtime1.cpp

Print this page
rev 49948 : 8201593: Print array length in ArrayIndexOutOfBoundsException.
Reviewed-by: dholmes, mdoerr, smonteith


 624   nmethod* nm = NULL;
 625   address continuation = NULL;
 626   {
 627     // Enter VM mode by calling the helper
 628     ResetNoHandleMark rnhm;
 629     continuation = exception_handler_for_pc_helper(thread, exception, pc, nm);
 630   }
 631   // Back in JAVA, use no oops DON'T safepoint
 632 
 633   // Now check to see if the nmethod we were called from is now deoptimized.
 634   // If so we must return to the deopt blob and deoptimize the nmethod
 635   if (nm != NULL && caller_is_deopted()) {
 636     continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
 637   }
 638 
 639   assert(continuation != NULL, "no handler found");
 640   return continuation;
 641 }
 642 
 643 
 644 JRT_ENTRY(void, Runtime1::throw_range_check_exception(JavaThread* thread, int index))
 645   NOT_PRODUCT(_throw_range_check_exception_count++;)
 646   char message[jintAsStringSize];
 647   sprintf(message, "%d", index);


 648   SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), message);
 649 JRT_END
 650 
 651 
 652 JRT_ENTRY(void, Runtime1::throw_index_exception(JavaThread* thread, int index))
 653   NOT_PRODUCT(_throw_index_exception_count++;)
 654   char message[16];
 655   sprintf(message, "%d", index);
 656   SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_IndexOutOfBoundsException(), message);
 657 JRT_END
 658 
 659 
 660 JRT_ENTRY(void, Runtime1::throw_div0_exception(JavaThread* thread))
 661   NOT_PRODUCT(_throw_div0_exception_count++;)
 662   SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArithmeticException(), "/ by zero");
 663 JRT_END
 664 
 665 
 666 JRT_ENTRY(void, Runtime1::throw_null_pointer_exception(JavaThread* thread))
 667   NOT_PRODUCT(_throw_null_pointer_exception_count++;)




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


< prev index next >