Top


定義場所(file name)

hotspot/src/share/vm/prims/jni.cpp

名前(function name)

JNI_ENTRY(void, jni_SetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value))

本体部(body)

  {- -------------------------------------------
  (1) (デバッグ用の処理)
      (See: JNIWrapper)
      ---------------------------------------- -}

      JNIWrapper("SetStaticObjectField");

  {- -------------------------------------------
  (1) (DTrace のフック点)
      ---------------------------------------- -}

      DTRACE_PROBE4(hotspot_jni, SetStaticObjectField__entry, env, clazz, fieldID, value);

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

      JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID);
      assert(id->is_static_field_id(), "invalid static field id");

  {- -------------------------------------------
  (1) (JVMTI のフック点)
      ---------------------------------------- -}

      // Keep JVMTI addition small and only check enabled flag here.
      // jni_SetField_probe() assumes that is okay to create handles.
      if (JvmtiExport::should_post_field_modification()) {
        jvalue field_value;
        field_value.l = value;
        JvmtiExport::jni_SetField_probe(thread, NULL, NULL, id->holder(), fieldID, true, 'L', (jvalue *)&field_value);
      }

  {- -------------------------------------------
  (1) oopDesc::obj_field_put() を呼んで, フィールドに値を書き込む.
      ---------------------------------------- -}

      id->holder()->java_mirror()->obj_field_put(id->offset(), JNIHandles::resolve(value));

  {- -------------------------------------------
  (1) (DTrace のフック点)
      ---------------------------------------- -}

      DTRACE_PROBE(hotspot_jni, SetStaticObjectField__return);
    JNI_END

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