Top


定義場所(file name)

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

本体部(body)

    #define DEFINE_CALLMETHOD(ResultType, Result, Tag) \
    \
      DT_RETURN_MARK_DECL_FOR(Result, Call##Result##Method, ResultType);\
      DT_RETURN_MARK_DECL_FOR(Result, Call##Result##MethodV, ResultType);\
      DT_RETURN_MARK_DECL_FOR(Result, Call##Result##MethodA, ResultType);\
    \
    JNI_ENTRY(ResultType, \
              jni_Call##Result##Method(JNIEnv *env, jobject obj, jmethodID methodID, ...)) \
      JNIWrapper("Call" XSTR(Result) "Method"); \
    \
      DTRACE_PROBE3(hotspot_jni, Call##Result##Method__entry, env, obj, methodID);\
      ResultType ret = 0;\
      DT_RETURN_MARK_FOR(Result, Call##Result##Method, ResultType, \
                         (const ResultType&)ret);\
    \
      va_list args; \
      va_start(args, methodID); \
      JavaValue jvalue(Tag); \
      JNI_ArgumentPusherVaArg ap(methodID, args); \
      jni_invoke_nonstatic(env, &jvalue, obj, JNI_VIRTUAL, methodID, &ap, CHECK_0); \
      va_end(args); \
      ret = jvalue.get_##ResultType(); \
      return ret;\
    JNI_END \
    \
    \
    JNI_ENTRY(ResultType, \
              jni_Call##Result##MethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)) \
      JNIWrapper("Call" XSTR(Result) "MethodV"); \
    \
      DTRACE_PROBE3(hotspot_jni, Call##Result##MethodV__entry, env, obj, methodID);\
      ResultType ret = 0;\
      DT_RETURN_MARK_FOR(Result, Call##Result##MethodV, ResultType, \
                         (const ResultType&)ret);\
    \
      JavaValue jvalue(Tag); \
      JNI_ArgumentPusherVaArg ap(methodID, args); \
      jni_invoke_nonstatic(env, &jvalue, obj, JNI_VIRTUAL, methodID, &ap, CHECK_0); \
      ret = jvalue.get_##ResultType(); \
      return ret;\
    JNI_END \
    \
    \
    JNI_ENTRY(ResultType, \
              jni_Call##Result##MethodA(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args)) \
      JNIWrapper("Call" XSTR(Result) "MethodA"); \
      DTRACE_PROBE3(hotspot_jni, Call##Result##MethodA__entry, env, obj, methodID);\
      ResultType ret = 0;\
      DT_RETURN_MARK_FOR(Result, Call##Result##MethodA, ResultType, \
                         (const ResultType&)ret);\
    \
      JavaValue jvalue(Tag); \
      JNI_ArgumentPusherArray ap(methodID, args); \
      jni_invoke_nonstatic(env, &jvalue, obj, JNI_VIRTUAL, methodID, &ap, CHECK_0); \
      ret = jvalue.get_##ResultType(); \
      return ret;\
    JNI_END

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