292 "this klass should have been initialized during VM initialization"); 293 // create instance - do not call constructor since we may have no 294 // (java) stack space left (should assert constructor is empty) 295 Handle exception; 296 oop exception_oop = klass->allocate_instance(CHECK_(exception)); 297 exception = Handle(THREAD, exception_oop); 298 if (StackTraceInThrowable) { 299 java_lang_Throwable::fill_in_stack_trace(exception); 300 } 301 return exception; 302 } 303 304 // Special handling for stack overflow: since we don't have any (java) stack 305 // space left we use the pre-allocated & pre-initialized StackOverflowError 306 // klass to create an stack overflow error instance. We do not call its 307 // constructor for the same reason (it is empty, anyway). 308 IRT_ENTRY(void, InterpreterRuntime::throw_StackOverflowError(JavaThread* thread)) 309 Handle exception = get_preinitialized_exception( 310 SystemDictionary::StackOverflowError_klass(), 311 CHECK); 312 THROW_HANDLE(exception); 313 IRT_END 314 315 316 IRT_ENTRY(void, InterpreterRuntime::create_exception(JavaThread* thread, char* name, char* message)) 317 // lookup exception klass 318 TempNewSymbol s = SymbolTable::new_symbol(name, CHECK); 319 if (ProfileTraps) { 320 if (s == vmSymbols::java_lang_ArithmeticException()) { 321 note_trap(thread, Deoptimization::Reason_div0_check, CHECK); 322 } else if (s == vmSymbols::java_lang_NullPointerException()) { 323 note_trap(thread, Deoptimization::Reason_null_check, CHECK); 324 } 325 } 326 // create exception 327 Handle exception = Exceptions::new_exception(thread, s, message); 328 thread->set_vm_result(exception()); 329 IRT_END 330 331 | 292 "this klass should have been initialized during VM initialization"); 293 // create instance - do not call constructor since we may have no 294 // (java) stack space left (should assert constructor is empty) 295 Handle exception; 296 oop exception_oop = klass->allocate_instance(CHECK_(exception)); 297 exception = Handle(THREAD, exception_oop); 298 if (StackTraceInThrowable) { 299 java_lang_Throwable::fill_in_stack_trace(exception); 300 } 301 return exception; 302 } 303 304 // Special handling for stack overflow: since we don't have any (java) stack 305 // space left we use the pre-allocated & pre-initialized StackOverflowError 306 // klass to create an stack overflow error instance. We do not call its 307 // constructor for the same reason (it is empty, anyway). 308 IRT_ENTRY(void, InterpreterRuntime::throw_StackOverflowError(JavaThread* thread)) 309 Handle exception = get_preinitialized_exception( 310 SystemDictionary::StackOverflowError_klass(), 311 CHECK); 312 // Increment counter for hs_err file reporting 313 Atomic::inc(&Exceptions::_stack_overflow_errors); 314 THROW_HANDLE(exception); 315 IRT_END 316 317 318 IRT_ENTRY(void, InterpreterRuntime::create_exception(JavaThread* thread, char* name, char* message)) 319 // lookup exception klass 320 TempNewSymbol s = SymbolTable::new_symbol(name, CHECK); 321 if (ProfileTraps) { 322 if (s == vmSymbols::java_lang_ArithmeticException()) { 323 note_trap(thread, Deoptimization::Reason_div0_check, CHECK); 324 } else if (s == vmSymbols::java_lang_NullPointerException()) { 325 note_trap(thread, Deoptimization::Reason_null_check, CHECK); 326 } 327 } 328 // create exception 329 Handle exception = Exceptions::new_exception(thread, s, message); 330 thread->set_vm_result(exception()); 331 IRT_END 332 333 |