56 #include "runtime/frame.inline.hpp" |
56 #include "runtime/frame.inline.hpp" |
57 #include "runtime/handles.inline.hpp" |
57 #include "runtime/handles.inline.hpp" |
58 #include "runtime/icache.hpp" |
58 #include "runtime/icache.hpp" |
59 #include "runtime/interfaceSupport.inline.hpp" |
59 #include "runtime/interfaceSupport.inline.hpp" |
60 #include "runtime/java.hpp" |
60 #include "runtime/java.hpp" |
|
61 #include "runtime/javaCalls.hpp" |
61 #include "runtime/jfieldIDWorkaround.hpp" |
62 #include "runtime/jfieldIDWorkaround.hpp" |
62 #include "runtime/osThread.hpp" |
63 #include "runtime/osThread.hpp" |
63 #include "runtime/sharedRuntime.hpp" |
64 #include "runtime/sharedRuntime.hpp" |
64 #include "runtime/stubRoutines.hpp" |
65 #include "runtime/stubRoutines.hpp" |
65 #include "runtime/synchronizer.hpp" |
66 #include "runtime/synchronizer.hpp" |
444 // create exception, with klass name as detail message |
445 // create exception, with klass name as detail message |
445 Handle exception = Exceptions::new_exception(thread, s, klass_name); |
446 Handle exception = Exceptions::new_exception(thread, s, klass_name); |
446 thread->set_vm_result(exception()); |
447 thread->set_vm_result(exception()); |
447 IRT_END |
448 IRT_END |
448 |
449 |
449 |
450 IRT_ENTRY(void, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException(JavaThread* thread, arrayOopDesc* a, jint index)) |
450 IRT_ENTRY(void, InterpreterRuntime::throw_ArrayIndexOutOfBoundsException(JavaThread* thread, char* name, jint index)) |
|
451 char message[jintAsStringSize]; |
|
452 // lookup exception klass |
|
453 TempNewSymbol s = SymbolTable::new_symbol(name, CHECK); |
|
454 if (ProfileTraps) { |
451 if (ProfileTraps) { |
455 note_trap(thread, Deoptimization::Reason_range_check, CHECK); |
452 note_trap(thread, Deoptimization::Reason_range_check, CHECK); |
456 } |
453 } |
457 // create exception |
454 |
458 sprintf(message, "%d", index); |
455 ResourceMark rm(thread); |
459 THROW_MSG(s, message); |
456 stringStream ss; |
|
457 ss.print("Index %d out of bounds for length %d", index, a->length()); |
|
458 |
|
459 THROW_MSG(vmSymbols::java_lang_ArrayIndexOutOfBoundsException(), ss.as_string()); |
460 IRT_END |
460 IRT_END |
461 |
461 |
462 IRT_ENTRY(void, InterpreterRuntime::throw_ClassCastException( |
462 IRT_ENTRY(void, InterpreterRuntime::throw_ClassCastException( |
463 JavaThread* thread, oopDesc* obj)) |
463 JavaThread* thread, oopDesc* obj)) |
464 |
464 |