Top


定義場所(file name)

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

本体部(body)

    #define DEFINE_SETSTATICFIELD(Argument,Fieldname,Result,SigType,unionType) \
    \
    JNI_ENTRY(void, jni_SetStatic##Result##Field(JNIEnv *env, jclass clazz, jfieldID fieldID, Argument value)) \
      JNIWrapper("SetStatic" XSTR(Result) "Field"); \
      HS_DTRACE_PROBE_CDECL_N(hotspot_jni, SetStatic##Result##Field__entry,\
        ( JNIEnv*, jclass, jfieldID FP_SELECT_##Result(COMMA Argument,/*empty*/) ) ); \
      HS_DTRACE_PROBE_N(hotspot_jni, SetStatic##Result##Field__entry, \
        ( env, clazz, fieldID FP_SELECT_##Result(COMMA value,/*empty*/) ) ); \
    \
      JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); \
      assert(id->is_static_field_id(), "invalid static field id"); \
      /* 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.unionType = value; \
        JvmtiExport::jni_SetField_probe(thread, NULL, NULL, id->holder(), fieldID, true, SigType, (jvalue *)&field_value); \
      } \
      id->holder()->java_mirror()-> Fieldname##_field_put (id->offset(), value); \
      DTRACE_PROBE(hotspot_jni, SetStatic##Result##Field__return);\
    JNI_END

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