hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
static Handle get_preinitialized_exception(klassOop k, TRAPS) {
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
// get klass
instanceKlass* klass = instanceKlass::cast(k);
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
assert(klass->is_initialized(),
"this klass should have been initialized during VM initialization");
{- -------------------------------------------
(1) instanceKlass::allocate_instance() を呼んで, 例外オブジェクトを生成する.
(なお, スタック領域に空きがないかもしれないため, コンストラクタの呼び出しは行わない)
---------------------------------------- -}
// create instance - do not call constructor since we may have no
// (java) stack space left (should assert constructor is empty)
Handle exception;
oop exception_oop = klass->allocate_instance(CHECK_(exception));
exception = Handle(THREAD, exception_oop);
{- -------------------------------------------
(1) java_lang_Throwable::fill_in_stack_trace() を呼んで, スタックトレース情報を埋めておく.
(ただし, StackTraceInThrowable オプションが指定されてない場合は, この処理は省略)
---------------------------------------- -}
if (StackTraceInThrowable) {
java_lang_Throwable::fill_in_stack_trace(exception);
}
{- -------------------------------------------
(1) 生成した例外オブジェクトをリターン.
---------------------------------------- -}
return exception;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.