Up Top

JNI の処理 : JNI Functions の処理 : ローカル参照/グローバル参照の処理(Global and Local References) : JNI 参照の生成/破棄


該当する JNI 関数

概要(Summary)

NewGlobalRef() や NewLocalRef() の処理は, 指定された oop を Thread::active_handles や JNIHandles::_globalhandles 内に格納するだけ.

逆に, DeleteGlobalRef() や DeleteLocalRef() の処理は, JNIHandleBlock 内の対応する箇所に JNIHandles::_deleted_handle の値を書き込むだけ.

(See: JNIHandleBlock)

備考(Notes)

処理の流れ (概要)(Execution Flows : Summary)

NewGlobalRef() の処理

jni_NewGlobalRef()
-> JNIHandles::make_global()
   -> JNIHandleBlock::allocate_handle()
      -> JNIHandleBlock::rebuild_free_list()  (<= どうしても空きが見つからない場合に呼び出す)

DeleteGlobalRef() の処理

jni_DeleteGlobalRef()
-> JNIHandles::destroy_global()

DeleteLocalRef() の処理

jni_DeleteLocalRef()
-> JNIHandles::destroy_local()

NewLocalRef() の処理

jni_NewLocalRef()
-> JNIHandles::make_local(JNIEnv* env, oop obj)
   -> JNIHandleBlock::allocate_handle()
      -> (同上)

処理の流れ (詳細)(Execution Flows : Details)

jni_NewGlobalRef()

See: here for details

JNIHandles::make_global()

See: here for details

JNIHandleBlock::allocate_handle()

See: here for details

JNIHandleBlock::rebuild_free_list()

See: here for details

jni_DeleteGlobalRef()

See: here for details

JNIHandles::destroy_global()

See: here for details

jni_DeleteLocalRef()

See: here for details

JNIHandles::destroy_local()

See: here for details

jni_NewLocalRef()

See: here for details

JNIHandles::make_local(JNIEnv* env, oop obj)

See: here for details


This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.