hotspot/src/share/vm/prims/jni.cpp
JNI_QUICK_ENTRY(jboolean, jni_IsSameObject(JNIEnv *env, jobject r1, jobject r2))
{- -------------------------------------------
(1) (デバッグ用の処理)
(See: JNIWrapper)
---------------------------------------- -}
JNIWrapper("IsSameObject");
{- -------------------------------------------
(1) (DTrace のフック点)
---------------------------------------- -}
DTRACE_PROBE3(hotspot_jni, IsSameObject__entry, env, r1, r2);
{- -------------------------------------------
(1) JNIHandles::resolve() でそれぞれの JNIHandle オブジェクト内の oop を取得し, ポインタ値の比較を行うだけ.
(返値は, 同じであれば JNI_TRUE, 違っていれば JNI_FALSE)
---------------------------------------- -}
oop a = JNIHandles::resolve(r1);
oop b = JNIHandles::resolve(r2);
jboolean ret = (a == b) ? JNI_TRUE : JNI_FALSE;
{- -------------------------------------------
(1) (DTrace のフック点)
---------------------------------------- -}
DTRACE_PROBE1(hotspot_jni, IsSameObject__return, ret);
{- -------------------------------------------
(1) 結果をリターン
---------------------------------------- -}
return ret;
JNI_END
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.