hotspot/src/share/vm/utilities/exceptions.cpp
bool Exceptions::special_exception(Thread* thread, const char* file, int line, Handle h_exception) {
{- -------------------------------------------
(1) もし初期化途中の段階であれば, vm_exit_during_initialization() で終了.
---------------------------------------- -}
// bootstrapping check
if (!Universe::is_fully_initialized()) {
vm_exit_during_initialization(h_exception);
ShouldNotReachHere();
}
{- -------------------------------------------
(1) (デバッグ用の処理) (#ifdef ASSERT 時にのみ実行)
---------------------------------------- -}
#ifdef ASSERT
// Check for trying to throw stack overflow before initialization is complete
// to prevent infinite recursion trying to initialize stack overflow without
// adequate stack space.
// This can happen with stress testing a large value of StackShadowPages
if (h_exception()->klass() == SystemDictionary::StackOverflowError_klass()) {
instanceKlass* ik = instanceKlass::cast(h_exception->klass());
assert(ik->is_initialized(),
"need to increase min_stack_allowed calculation");
}
#endif // ASSERT
{- -------------------------------------------
(1) もし, 引数で指定されたスレッドが VMThread か CompilerThread であれば,
適当な(ダミーの)例外オブジェクトを pending_exception にセットすることにする.
この場合, (pending_exception へのセットはここでやってしまうので) true をリターン.
---------------------------------------- -}
if (thread->is_VM_thread()
|| thread->is_Compiler_thread() ) {
// We do not care what kind of exception we get for the vm-thread or a thread which
// is compiling. We just install a dummy exception object
thread->set_pending_exception(Universe::vm_exception(), file, line);
return true;
}
{- -------------------------------------------
(1) 以上のどれでもなければ, false をリターン.
---------------------------------------- -}
return false;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.