< prev index next >

src/hotspot/share/interpreter/interpreterRuntime.cpp

Print this page

 355   // (java) stack space left (should assert constructor is empty)
 356   Handle exception;
 357   oop exception_oop = klass->allocate_instance(CHECK_(exception));
 358   exception = Handle(THREAD, exception_oop);
 359   if (StackTraceInThrowable) {
 360     java_lang_Throwable::fill_in_stack_trace(exception);
 361   }
 362   return exception;
 363 }
 364 
 365 // Special handling for stack overflow: since we don't have any (java) stack
 366 // space left we use the pre-allocated & pre-initialized StackOverflowError
 367 // klass to create an stack overflow error instance.  We do not call its
 368 // constructor for the same reason (it is empty, anyway).
 369 JRT_ENTRY(void, InterpreterRuntime::throw_StackOverflowError(JavaThread* current))
 370   Handle exception = get_preinitialized_exception(
 371                                  vmClasses::StackOverflowError_klass(),
 372                                  CHECK);
 373   // Increment counter for hs_err file reporting
 374   Atomic::inc(&Exceptions::_stack_overflow_errors);



 375   THROW_HANDLE(exception);
 376 JRT_END
 377 
 378 JRT_ENTRY(void, InterpreterRuntime::throw_delayed_StackOverflowError(JavaThread* current))
 379   Handle exception = get_preinitialized_exception(
 380                                  vmClasses::StackOverflowError_klass(),
 381                                  CHECK);
 382   java_lang_Throwable::set_message(exception(),
 383           Universe::delayed_stack_overflow_error_message());
 384   // Increment counter for hs_err file reporting
 385   Atomic::inc(&Exceptions::_stack_overflow_errors);



 386   THROW_HANDLE(exception);
 387 JRT_END
 388 
 389 JRT_ENTRY(void, InterpreterRuntime::create_exception(JavaThread* current, char* name, char* message))
 390   // lookup exception klass
 391   TempNewSymbol s = SymbolTable::new_symbol(name);
 392   if (ProfileTraps) {
 393     if (s == vmSymbols::java_lang_ArithmeticException()) {
 394       note_trap(current, Deoptimization::Reason_div0_check);
 395     } else if (s == vmSymbols::java_lang_NullPointerException()) {
 396       note_trap(current, Deoptimization::Reason_null_check);
 397     }
 398   }
 399   // create exception
 400   Handle exception = Exceptions::new_exception(current, s, message);
 401   current->set_vm_result(exception());
 402 JRT_END
 403 
 404 
 405 JRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* current, char* name, oopDesc* obj))

 355   // (java) stack space left (should assert constructor is empty)
 356   Handle exception;
 357   oop exception_oop = klass->allocate_instance(CHECK_(exception));
 358   exception = Handle(THREAD, exception_oop);
 359   if (StackTraceInThrowable) {
 360     java_lang_Throwable::fill_in_stack_trace(exception);
 361   }
 362   return exception;
 363 }
 364 
 365 // Special handling for stack overflow: since we don't have any (java) stack
 366 // space left we use the pre-allocated & pre-initialized StackOverflowError
 367 // klass to create an stack overflow error instance.  We do not call its
 368 // constructor for the same reason (it is empty, anyway).
 369 JRT_ENTRY(void, InterpreterRuntime::throw_StackOverflowError(JavaThread* current))
 370   Handle exception = get_preinitialized_exception(
 371                                  vmClasses::StackOverflowError_klass(),
 372                                  CHECK);
 373   // Increment counter for hs_err file reporting
 374   Atomic::inc(&Exceptions::_stack_overflow_errors);
 375   // Remove the ScopedValue bindings in case we got a StackOverflowError
 376   // while we were trying to manipulate ScopedValue bindings.
 377   current->clear_scopedValueBindings();
 378   THROW_HANDLE(exception);
 379 JRT_END
 380 
 381 JRT_ENTRY(void, InterpreterRuntime::throw_delayed_StackOverflowError(JavaThread* current))
 382   Handle exception = get_preinitialized_exception(
 383                                  vmClasses::StackOverflowError_klass(),
 384                                  CHECK);
 385   java_lang_Throwable::set_message(exception(),
 386           Universe::delayed_stack_overflow_error_message());
 387   // Increment counter for hs_err file reporting
 388   Atomic::inc(&Exceptions::_stack_overflow_errors);
 389   // Remove the ScopedValue bindings in case we got a StackOverflowError
 390   // while we were trying to manipulate ScopedValue bindings.
 391   current->clear_scopedValueBindings();
 392   THROW_HANDLE(exception);
 393 JRT_END
 394 
 395 JRT_ENTRY(void, InterpreterRuntime::create_exception(JavaThread* current, char* name, char* message))
 396   // lookup exception klass
 397   TempNewSymbol s = SymbolTable::new_symbol(name);
 398   if (ProfileTraps) {
 399     if (s == vmSymbols::java_lang_ArithmeticException()) {
 400       note_trap(current, Deoptimization::Reason_div0_check);
 401     } else if (s == vmSymbols::java_lang_NullPointerException()) {
 402       note_trap(current, Deoptimization::Reason_null_check);
 403     }
 404   }
 405   // create exception
 406   Handle exception = Exceptions::new_exception(current, s, message);
 407   current->set_vm_result(exception());
 408 JRT_END
 409 
 410 
 411 JRT_ENTRY(void, InterpreterRuntime::create_klass_exception(JavaThread* current, char* name, oopDesc* obj))
< prev index next >