< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/earlyretlong.cpp
Print this page
rev 51722 : 8210700: Clean up JNI_ENV_ARG and factorize the macros for vmTestbase/jvmti/unit tests
Summary:
Reviewed-by:
*** 26,50 ****
#include "jvmti.h"
#include "jni_tools.h"
#include "agent_common.h"
#include "JVMTITools.h"
- #ifdef __cplusplus
extern "C" {
- #endif
-
- #ifndef JNI_ENV_ARG
-
- #ifdef __cplusplus
- #define JNI_ENV_ARG(x, y) y
- #define JNI_ENV_PTR(x) x
- #else
- #define JNI_ENV_ARG(x,y) x, y
- #define JNI_ENV_PTR(x) (*x)
- #endif
- #endif
#define PASSED 0
#define STATUS_FAILED 2
#define RETURN_FAILED errCode = STATUS_FAILED; fflush(0); return
--- 26,37 ----
*** 311,322 ****
printf("Printdump is turned on!\n");
printdump = JNI_TRUE;
}
! res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
! JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong error code from a valid call to GetEnv!\n");
return JNI_ERR;
}
--- 298,308 ----
printf("Printdump is turned on!\n");
printdump = JNI_TRUE;
}
! res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong error code from a valid call to GetEnv!\n");
return JNI_ERR;
}
*** 381,406 ****
!caps.can_generate_method_exit_events ||
!caps.can_generate_single_step_events) {
return;
}
! midRun = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
! "run", "()V");
if (midRun == NULL) {
printf("Cannot find Method ID for method run\n");
RETURN_FAILED;
}
! midCheckPoint = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
! "checkPoint", "()V");
if (midCheckPoint == NULL) {
printf("Cannot find Method ID for method checkPoint\n");
RETURN_FAILED;
}
! midCountDownLong = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
! "countDownLong", "(I)J");
if (midCountDownLong == NULL) {
printf("Cannot find Method ID for method countDownLong\n");
RETURN_FAILED;
}
--- 367,389 ----
!caps.can_generate_method_exit_events ||
!caps.can_generate_single_step_events) {
return;
}
! midRun = env->GetMethodID(cls, "run", "()V");
if (midRun == NULL) {
printf("Cannot find Method ID for method run\n");
RETURN_FAILED;
}
! midCheckPoint = env->GetMethodID(cls, "checkPoint", "()V");
if (midCheckPoint == NULL) {
printf("Cannot find Method ID for method checkPoint\n");
RETURN_FAILED;
}
! midCountDownLong = env->GetMethodID(cls, "countDownLong", "(I)J");
if (midCountDownLong == NULL) {
printf("Cannot find Method ID for method countDownLong\n");
RETURN_FAILED;
}
*** 442,449 ****
}
fflush(0);
return errCode;
}
- #ifdef __cplusplus
}
- #endif
--- 425,430 ----
< prev index next >