src/hotspot/share/interpreter/interpreterRuntime.cpp
changeset 51170 7410cb248bbf
parent 50094 2f79462aab9b
child 51444 3e5d28e6de32
equal deleted inserted replaced
51169:0058ffa0a922 51170:7410cb248bbf
   433   thread->set_vm_result(exception());
   433   thread->set_vm_result(exception());
   434 IRT_END
   434 IRT_END
   435 
   435 
   436 
   436 
   437 IRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* thread, char* name, oopDesc* obj))
   437 IRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* thread, char* name, oopDesc* obj))
       
   438   // Produce the error message first because note_trap can safepoint
   438   ResourceMark rm(thread);
   439   ResourceMark rm(thread);
   439   const char* klass_name = obj->klass()->external_name();
   440   const char* klass_name = obj->klass()->external_name();
   440   // lookup exception klass
   441   // lookup exception klass
   441   TempNewSymbol s = SymbolTable::new_symbol(name, CHECK);
   442   TempNewSymbol s = SymbolTable::new_symbol(name, CHECK);
   442   if (ProfileTraps) {
   443   if (ProfileTraps) {
   446   Handle exception = Exceptions::new_exception(thread, s, klass_name);
   447   Handle exception = Exceptions::new_exception(thread, s, klass_name);
   447   thread->set_vm_result(exception());
   448   thread->set_vm_result(exception());
   448 IRT_END
   449 IRT_END
   449 
   450 
   450 IRT_ENTRY(void, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException(JavaThread* thread, arrayOopDesc* a, jint index))
   451 IRT_ENTRY(void, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException(JavaThread* thread, arrayOopDesc* a, jint index))
   451   if (ProfileTraps) {
   452   // Produce the error message first because note_trap can safepoint
   452     note_trap(thread, Deoptimization::Reason_range_check, CHECK);
       
   453   }
       
   454 
       
   455   ResourceMark rm(thread);
   453   ResourceMark rm(thread);
   456   stringStream ss;
   454   stringStream ss;
   457   ss.print("Index %d out of bounds for length %d", index, a->length());
   455   ss.print("Index %d out of bounds for length %d", index, a->length());
   458 
   456 
       
   457   if (ProfileTraps) {
       
   458     note_trap(thread, Deoptimization::Reason_range_check, CHECK);
       
   459   }
       
   460 
   459   THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
   461   THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string());
   460 IRT_END
   462 IRT_END
   461 
   463 
   462 IRT_ENTRY(void, InterpreterRuntime::throw_ClassCastException(
   464 IRT_ENTRY(void, InterpreterRuntime::throw_ClassCastException(
   463   JavaThread* thread, oopDesc* obj))
   465   JavaThread* thread, oopDesc* obj))
   464 
   466 
       
   467   // Produce the error message first because note_trap can safepoint
   465   ResourceMark rm(thread);
   468   ResourceMark rm(thread);
   466   char* message = SharedRuntime::generate_class_cast_message(
   469   char* message = SharedRuntime::generate_class_cast_message(
   467     thread, obj->klass());
   470     thread, obj->klass());
   468 
   471 
   469   if (ProfileTraps) {
   472   if (ProfileTraps) {