8210385: Clean up JNI_ENV_ARG and factorize the macros for vmTestbase/jvmti[A-N] tests
Summary: Remove JNI_ENV and JVMTI_ENV macros for part of the jvmti tests
Reviewed-by: amenkov, dholmes
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -75,8 +62,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->
- GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -185,6 +171,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassPrepare/classprep001/classprep001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassPrepare/classprep001/classprep001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -257,8 +244,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->
- GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -333,6 +319,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk001/clrbrk001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk001/clrbrk001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -79,8 +66,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -131,8 +117,7 @@
JNIEXPORT void JNICALL
Java_nsk_jvmti_ClearBreakpoint_clrbrk001_getReady(JNIEnv *env, jclass cls, jint i) {
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
- "trial", "(I)I");
+ mid = env->GetStaticMethodID(cls, "trial", "(I)I");
if (mid == NULL) {
printf("Cannot find method \"trial(I)I\"\n");
result = STATUS_FAILED;
@@ -213,6 +198,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk002/clrbrk002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk002/clrbrk002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -70,8 +57,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -121,8 +107,7 @@
return result;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
- "run", "([Ljava/lang/String;Ljava/io/PrintStream;)I");
+ mid = env->GetStaticMethodID(cls, "run", "([Ljava/lang/String;Ljava/io/PrintStream;)I");
if (mid == NULL) {
printf("Cannot find method run\n");
return STATUS_FAILED;
@@ -158,6 +143,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk005/clrbrk005.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk005/clrbrk005.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -70,8 +57,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -119,8 +105,7 @@
return result;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
- "checkPoint", "()V");
+ mid = env->GetStaticMethodID(cls, "checkPoint", "()V");
if (mid == 0) {
printf("Cannot find Method ID for method checkPoint\n");
return STATUS_FAILED;
@@ -153,6 +138,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001/clrfldw001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001/clrfldw001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -74,14 +61,12 @@
field fld = fields[ind];
const char *msg;
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, fld.klass));
+ cls = env->FindClass(fld.klass);
if (fld.fid == NULL) {
if (fld.stat) {
- fields[ind].fid = JNI_ENV_PTR(env)->
- GetStaticFieldID(JNI_ENV_ARG(env, cls), fld.name, fld.sig);
+ fields[ind].fid = env->GetStaticFieldID(cls, fld.name, fld.sig);
} else {
- fields[ind].fid = JNI_ENV_PTR(env)->
- GetFieldID(JNI_ENV_ARG(env, cls), fld.name, fld.sig);
+ fields[ind].fid = env->GetFieldID(cls, fld.name, fld.sig);
}
}
@@ -123,8 +108,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@@ -191,7 +175,7 @@
jobject obj) {
jint val;
- val = JNI_ENV_PTR(env)->GetIntField(JNI_ENV_ARG(env, obj), fields[0].fid);
+ val = env->GetIntField(obj, fields[0].fid);
}
JNIEXPORT void JNICALL
@@ -216,6 +200,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw002/clrfldw002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw002/clrfldw002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -71,8 +58,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@@ -128,10 +114,8 @@
jvmtiError err;
jfieldID fid1, fid2;
- fid1 = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls),
- "fld1", "I");
- fid2 = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls),
- "fld2", "I");
+ fid1 = env->GetStaticFieldID(cls, "fld1", "I");
+ fid2 = env->GetStaticFieldID(cls, "fld2", "I");
if (!caps.can_generate_field_access_events) {
err = jvmti->ClearFieldAccessWatch(cls, fid1);
@@ -169,6 +153,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001/clrfmodw001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001/clrfmodw001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -74,14 +61,12 @@
field fld = fields[ind];
const char *msg;
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, fld.klass));
+ cls = env->FindClass(fld.klass);
if (fld.fid == NULL) {
if (fld.stat) {
- fields[ind].fid = JNI_ENV_PTR(env)->
- GetStaticFieldID(JNI_ENV_ARG(env, cls), fld.name, fld.sig);
+ fields[ind].fid = env->GetStaticFieldID(cls, fld.name, fld.sig);
} else {
- fields[ind].fid = JNI_ENV_PTR(env)->
- GetFieldID(JNI_ENV_ARG(env, cls), fld.name, fld.sig);
+ fields[ind].fid = env->GetFieldID(cls, fld.name, fld.sig);
}
}
@@ -123,8 +108,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@@ -185,7 +169,7 @@
}
JNIEXPORT void JNICALL Java_nsk_jvmti_ClearFieldModificationWatch_clrfmodw001_touchfld0(JNIEnv *env, jobject obj) {
- JNI_ENV_PTR(env)->SetIntField(JNI_ENV_ARG(env, obj), fields[0].fid, 2000);
+ env->SetIntField(obj, fields[0].fid, 2000);
}
JNIEXPORT void JNICALL
@@ -208,6 +192,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw002/clrfmodw002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw002/clrfmodw002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -72,8 +59,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@@ -129,10 +115,8 @@
jvmtiError err;
jfieldID fid1, fid2;
- fid1 = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls),
- "fld1", "I");
- fid2 = JNI_ENV_PTR(env)->GetStaticFieldID(JNI_ENV_ARG(env, cls),
- "fld2", "I");
+ fid1 = env->GetStaticFieldID(cls, "fld1", "I");
+ fid2 = env->GetStaticFieldID(cls, "fld2", "I");
if (!caps.can_generate_field_modification_events) {
printf("Warning: ClearFieldModificationWatch is not implemented\n");
@@ -172,6 +156,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon001/crrawmon001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon001/crrawmon001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -96,8 +83,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -126,6 +112,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon002/crrawmon002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon002/crrawmon002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -111,6 +97,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Deallocate/dealloc001/dealloc001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Deallocate/dealloc001/dealloc001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->
- GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -103,6 +89,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon001/drrawmon001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon001/drrawmon001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -109,8 +96,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -139,6 +125,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon003/drrawmon003.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon003/drrawmon003.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -124,6 +110,4 @@
return PASSED;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon004/drrawmon004.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon004/drrawmon004.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -105,6 +91,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Exception/exception001/exception001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Exception/exception001/exception001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -102,7 +89,7 @@
if (printdump == JNI_TRUE) {
printf(">>> retrieving Exception info ...\n");
}
- cls = JNI_ENV_PTR(env)->GetObjectClass(JNI_ENV_ARG((JNIEnv *)env, exception));
+ cls = env->GetObjectClass(exception);
err = jvmti_env->GetClassSignature(cls, &ex.name, &generic);
if (err != JVMTI_ERROR_NONE) {
printf("(GetClassSignature) unexpected error: %s (%d)\n",
@@ -204,8 +191,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -263,26 +249,22 @@
return result;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/Exception/exception001c"));
+ clz = env->FindClass("nsk/jvmti/Exception/exception001c");
if (clz == NULL) {
printf("Cannot find exception001c class!\n");
return STATUS_FAILED;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/Exception/exception001b"));
+ clz = env->FindClass("nsk/jvmti/Exception/exception001b");
if (clz == NULL) {
printf("Cannot find exception001b class!\n");
return STATUS_FAILED;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/Exception/exception001a"));
+ clz = env->FindClass("nsk/jvmti/Exception/exception001a");
if (clz == NULL) {
printf("Cannot find exception001a class!\n");
return STATUS_FAILED;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, clz),
- "run", "()V");
+ mid = env->GetStaticMethodID(clz, "run", "()V");
if (mid == NULL) {
printf("Cannot find method run!\n");
return STATUS_FAILED;
@@ -304,7 +286,7 @@
result = STATUS_FAILED;
}
- JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, clz), mid);
+ env->CallStaticVoidMethod(clz, mid);
err = jvmti->SetEventNotificationMode(JVMTI_DISABLE,
JVMTI_EVENT_EXCEPTION, thread);
@@ -322,6 +304,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ExceptionCatch/excatch001/excatch001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ExceptionCatch/excatch001/excatch001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -90,7 +77,7 @@
if (printdump == JNI_TRUE) {
printf(">>> retrieving ExceptionCatch info ...\n");
}
- cls = JNI_ENV_PTR(env)->GetObjectClass(JNI_ENV_ARG((JNIEnv *)env, exception));
+ cls = env->GetObjectClass(exception);
err = jvmti_env->GetClassSignature(cls, &ex.name, &generic);
if (err != JVMTI_ERROR_NONE) {
printf("(GetClassSignature#e) unexpected error: %s (%d)\n",
@@ -163,8 +150,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -221,26 +207,22 @@
return result;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/ExceptionCatch/excatch001c"));
+ clz = env->FindClass("nsk/jvmti/ExceptionCatch/excatch001c");
if (clz == NULL) {
printf("Cannot find excatch001c class!\n");
return STATUS_FAILED;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/ExceptionCatch/excatch001b"));
+ clz = env->FindClass("nsk/jvmti/ExceptionCatch/excatch001b");
if (clz == NULL) {
printf("Cannot find excatch001b class!\n");
return STATUS_FAILED;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/ExceptionCatch/excatch001a"));
+ clz = env->FindClass("nsk/jvmti/ExceptionCatch/excatch001a");
if (clz == NULL) {
printf("Cannot find excatch001a class!\n");
return STATUS_FAILED;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, clz),
- "run", "()V");
+ mid = env->GetStaticMethodID(clz, "run", "()V");
if (mid == NULL) {
printf("Cannot find method run!\n");
return STATUS_FAILED;
@@ -256,7 +238,7 @@
result = STATUS_FAILED;
}
- JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, clz), mid);
+ env->CallStaticVoidMethod(clz, mid);
err = jvmti->SetEventNotificationMode(JVMTI_DISABLE,
JVMTI_EVENT_EXCEPTION_CATCH, NULL);
@@ -274,6 +256,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc001/fieldacc001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc001/fieldacc001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -258,8 +245,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -323,8 +309,7 @@
if (printdump == JNI_TRUE) {
printf(">>> setting field access watches ...\n");
}
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/FieldAccess/fieldacc001a"));
+ cls = env->FindClass("nsk/jvmti/FieldAccess/fieldacc001a");
if (cls == NULL) {
printf("Cannot find fieldacc001a class!\n");
result = STATUS_FAILED;
@@ -332,11 +317,11 @@
}
for (i = 0; i < sizeof(watches)/sizeof(watch_info); i++) {
if (watches[i].is_static == JNI_TRUE) {
- watches[i].fid = JNI_ENV_PTR(env)->GetStaticFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetStaticFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
} else {
- watches[i].fid = JNI_ENV_PTR(env)->GetFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
}
if (watches[i].fid == NULL) {
printf("Cannot find field \"%s\"!\n", watches[i].f_name);
@@ -367,6 +352,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc002/fieldacc002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc002/fieldacc002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -257,8 +244,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -321,8 +307,7 @@
printf(">>> setting field access watches ...\n");
}
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/FieldAccess/fieldacc002a"));
+ cls = env->FindClass("nsk/jvmti/FieldAccess/fieldacc002a");
if (cls == NULL) {
printf("Cannot find fieldacc002a class!\n");
result = STATUS_FAILED;
@@ -330,11 +315,11 @@
}
for (i = 0; i < sizeof(watches)/sizeof(watch_info); i++) {
if (watches[i].is_static == JNI_TRUE) {
- watches[i].fid = JNI_ENV_PTR(env)->GetStaticFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetStaticFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
} else {
- watches[i].fid = JNI_ENV_PTR(env)->GetFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
}
if (watches[i].fid == NULL) {
printf("Cannot find field \"%s\"!\n", watches[i].f_name);
@@ -368,44 +353,33 @@
printf(">>> accessing fields ...\n");
}
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/FieldAccess/fieldacc002a"));
+ cls = env->FindClass("nsk/jvmti/FieldAccess/fieldacc002a");
if (cls == NULL) {
printf("Cannot find fieldacc002a class!\n");
return STATUS_FAILED;
}
- JNI_ENV_PTR(env)->GetStaticBooleanField(JNI_ENV_ARG(env, cls),
- watches[0].fid);
- JNI_ENV_PTR(env)->GetStaticByteField(JNI_ENV_ARG(env, cls),
- watches[1].fid);
- JNI_ENV_PTR(env)->GetStaticShortField(JNI_ENV_ARG(env, cls),
- watches[2].fid);
- JNI_ENV_PTR(env)->GetStaticIntField(JNI_ENV_ARG(env, cls),
- watches[3].fid);
- JNI_ENV_PTR(env)->GetStaticLongField(JNI_ENV_ARG(env, cls),
- watches[4].fid);
- JNI_ENV_PTR(env)->GetStaticFloatField(JNI_ENV_ARG(env, cls),
- watches[5].fid);
- JNI_ENV_PTR(env)->GetStaticDoubleField(JNI_ENV_ARG(env, cls),
- watches[6].fid);
- JNI_ENV_PTR(env)->GetStaticCharField(JNI_ENV_ARG(env, cls),
- watches[7].fid);
- JNI_ENV_PTR(env)->GetStaticObjectField(JNI_ENV_ARG(env, cls),
- watches[8].fid);
- JNI_ENV_PTR(env)->GetStaticObjectField(JNI_ENV_ARG(env, cls),
- watches[9].fid);
+ env->GetStaticBooleanField(cls, watches[0].fid);
+ env->GetStaticByteField(cls, watches[1].fid);
+ env->GetStaticShortField(cls, watches[2].fid);
+ env->GetStaticIntField(cls, watches[3].fid);
+ env->GetStaticLongField(cls, watches[4].fid);
+ env->GetStaticFloatField(cls, watches[5].fid);
+ env->GetStaticDoubleField(cls, watches[6].fid);
+ env->GetStaticCharField(cls, watches[7].fid);
+ env->GetStaticObjectField(cls, watches[8].fid);
+ env->GetStaticObjectField(cls, watches[9].fid);
- JNI_ENV_PTR(env)->GetBooleanField(JNI_ENV_ARG(env, obj), watches[10].fid);
- JNI_ENV_PTR(env)->GetByteField(JNI_ENV_ARG(env, obj), watches[11].fid);
- JNI_ENV_PTR(env)->GetShortField(JNI_ENV_ARG(env, obj), watches[12].fid);
- JNI_ENV_PTR(env)->GetIntField(JNI_ENV_ARG(env, obj), watches[13].fid);
- JNI_ENV_PTR(env)->GetLongField(JNI_ENV_ARG(env, obj), watches[14].fid);
- JNI_ENV_PTR(env)->GetFloatField(JNI_ENV_ARG(env, obj), watches[15].fid);
- JNI_ENV_PTR(env)->GetDoubleField(JNI_ENV_ARG(env, obj), watches[16].fid);
- JNI_ENV_PTR(env)->GetCharField(JNI_ENV_ARG(env, obj), watches[17].fid);
- JNI_ENV_PTR(env)->GetObjectField(JNI_ENV_ARG(env, obj), watches[18].fid);
- JNI_ENV_PTR(env)->GetObjectField(JNI_ENV_ARG(env, obj), watches[19].fid);
+ env->GetBooleanField(obj, watches[10].fid);
+ env->GetByteField(obj, watches[11].fid);
+ env->GetShortField(obj, watches[12].fid);
+ env->GetIntField(obj, watches[13].fid);
+ env->GetLongField(obj, watches[14].fid);
+ env->GetFloatField(obj, watches[15].fid);
+ env->GetDoubleField(obj, watches[16].fid);
+ env->GetCharField(obj, watches[17].fid);
+ env->GetObjectField(obj, watches[18].fid);
+ env->GetObjectField(obj, watches[19].fid);
if (printdump == JNI_TRUE) {
printf(">>> ... done\n");
@@ -419,6 +393,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc003/fieldacc003.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc003/fieldacc003.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -237,8 +224,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -302,18 +288,18 @@
printf(">>> setting field access watches ...\n");
}
for (i = 0; i < sizeof(watches)/sizeof(watch_info); i++) {
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, watches[i].f_cls));
+ cls = env->FindClass(watches[i].f_cls);
if (cls == NULL) {
printf("Cannot find %s class!\n", watches[i].f_cls);
result = STATUS_FAILED;
return;
}
if (watches[i].is_static == JNI_TRUE) {
- watches[i].fid = JNI_ENV_PTR(env)->GetStaticFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetStaticFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
} else {
- watches[i].fid = JNI_ENV_PTR(env)->GetFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
}
if (watches[i].fid == NULL) {
printf("Cannot get field ID for \"%s:%s\"\n",
@@ -345,6 +331,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc004/fieldacc004.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldAccess/fieldacc004/fieldacc004.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -223,8 +210,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -288,18 +274,18 @@
printf(">>> setting field access watches ...\n");
}
for (i = 0; i < sizeof(watches)/sizeof(watch_info); i++) {
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, watches[i].f_cls));
+ cls = env->FindClass(watches[i].f_cls);
if (cls == NULL) {
printf("Cannot find %s class!\n", watches[i].f_cls);
result = STATUS_FAILED;
return;
}
if (watches[i].is_static == JNI_TRUE) {
- watches[i].fid = JNI_ENV_PTR(env)->GetStaticFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetStaticFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
} else {
- watches[i].fid = JNI_ENV_PTR(env)->GetFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
}
if (watches[i].fid == NULL) {
printf("Cannot get field ID for \"%s:%s\"\n",
@@ -331,6 +317,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldModification/fieldmod001/fieldmod001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldModification/fieldmod001/fieldmod001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -170,8 +157,7 @@
return (v1.d == v2.d);
case 'L':
case '[':
- return (JNI_TRUE ==
- JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, v1.l), v2.l));
+ return env->IsSameObject(v1.l, v2.l);
case 'Z':
return (v1.z == v2.z);
case 'B':
@@ -335,8 +321,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -400,8 +385,7 @@
if (printdump == JNI_TRUE) {
printf(">>> setting field modification watches ...\n");
}
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/FieldModification/fieldmod001a"));
+ cls = env->FindClass("nsk/jvmti/FieldModification/fieldmod001a");
if (cls == NULL) {
printf("Cannot find fieldmod001a class!\n");
result = STATUS_FAILED;
@@ -409,11 +393,11 @@
}
for (i = 0; i < sizeof(watches)/sizeof(watch_info); i++) {
if (watches[i].is_static == JNI_TRUE) {
- watches[i].fid = JNI_ENV_PTR(env)->GetStaticFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetStaticFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
} else {
- watches[i].fid = JNI_ENV_PTR(env)->GetFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
}
if (watches[i].fid == NULL) {
printf("Cannot get field ID for \"%s:%s\"\n",
@@ -468,6 +452,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldModification/fieldmod002/fieldmod002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FieldModification/fieldmod002/fieldmod002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -170,8 +157,7 @@
return (v1.d == v2.d);
case 'L':
case '[':
- return (JNI_TRUE ==
- JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, v1.l), v2.l));
+ return env->IsSameObject(v1.l, v2.l);
case 'Z':
return (v1.z == v2.z);
case 'B':
@@ -218,8 +204,7 @@
TranslateError(err), err);
result = STATUS_FAILED;
}
- err = jvmti_env->GetMethodName(method,
- &watch.m_name, &watch.m_sig, &generic);
+ err = jvmti_env->GetMethodName(method, &watch.m_name, &watch.m_sig, &generic);
if (err != JVMTI_ERROR_NONE) {
printf("(GetMethodName) unexpected error: %s (%d)\n",
TranslateError(err), err);
@@ -335,8 +320,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -402,8 +386,7 @@
if (printdump == JNI_TRUE) {
printf(">>> setting field modification watches ...\n");
}
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/FieldModification/fieldmod002a"));
+ cls = env->FindClass("nsk/jvmti/FieldModification/fieldmod002a");
if (cls == NULL) {
printf("Cannot find fieldmod001a class!\n");
result = STATUS_FAILED;
@@ -411,11 +394,11 @@
}
for (i = 0; i < sizeof(watches)/sizeof(watch_info); i++) {
if (watches[i].is_static == JNI_TRUE) {
- watches[i].fid = JNI_ENV_PTR(env)->GetStaticFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetStaticFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
} else {
- watches[i].fid = JNI_ENV_PTR(env)->GetFieldID(
- JNI_ENV_ARG(env, cls), watches[i].f_name, watches[i].f_sig);
+ watches[i].fid = env->GetFieldID(
+ cls, watches[i].f_name, watches[i].f_sig);
}
if (watches[i].fid == NULL) {
printf("Cannot get field ID for \"%s:%s\"\n",
@@ -433,16 +416,11 @@
}
}
- ctor = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
- "<init>", "()V");
- obj1 = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env,
- JNI_ENV_PTR(env)->NewObject(JNI_ENV_ARG(env, cls), ctor)));
- obj2 = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env,
- JNI_ENV_PTR(env)->NewObject(JNI_ENV_ARG(env, cls), ctor)));
- arr1 = (jintArray) JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env,
- JNI_ENV_PTR(env)->NewIntArray(JNI_ENV_ARG(env, (jsize)1))));
- arr2 = (jintArray) JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env,
- JNI_ENV_PTR(env)->NewIntArray(JNI_ENV_ARG(env, (jsize)1))));
+ ctor = env->GetMethodID(cls, "<init>", "()V");
+ obj1 = env->NewGlobalRef(env->NewObject(cls, ctor));
+ obj2 = env->NewGlobalRef(env->NewObject(cls, ctor));
+ arr1 = (jintArray) env->NewGlobalRef(env->NewIntArray((jsize) 1));
+ arr2 = (jintArray) env->NewGlobalRef(env->NewIntArray((jsize) 1));
watches[0].val.z = JNI_TRUE;
watches[1].val.b = 1;
@@ -480,60 +458,37 @@
return PASSED;
}
-
-
if (printdump == JNI_TRUE) {
printf(">>> modifying fields ...\n");
}
- cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/FieldModification/fieldmod002a"));
+ cls = env->FindClass("nsk/jvmti/FieldModification/fieldmod002a");
if (cls == NULL) {
printf("Cannot find fieldmod001a class!\n");
return STATUS_FAILED;
}
- JNI_ENV_PTR(env)->SetStaticBooleanField(JNI_ENV_ARG(env, cls),
- watches[0].fid, watches[0].val.z);
- JNI_ENV_PTR(env)->SetStaticByteField(JNI_ENV_ARG(env, cls),
- watches[1].fid, watches[1].val.b);
- JNI_ENV_PTR(env)->SetStaticShortField(JNI_ENV_ARG(env, cls),
- watches[2].fid, watches[2].val.s);
- JNI_ENV_PTR(env)->SetStaticIntField(JNI_ENV_ARG(env, cls),
- watches[3].fid, watches[3].val.i);
- JNI_ENV_PTR(env)->SetStaticLongField(JNI_ENV_ARG(env, cls),
- watches[4].fid, watches[4].val.j);
- JNI_ENV_PTR(env)->SetStaticFloatField(JNI_ENV_ARG(env, cls),
- watches[5].fid, watches[5].val.f);
- JNI_ENV_PTR(env)->SetStaticDoubleField(JNI_ENV_ARG(env, cls),
- watches[6].fid, watches[6].val.d);
- JNI_ENV_PTR(env)->SetStaticCharField(JNI_ENV_ARG(env, cls),
- watches[7].fid, watches[7].val.c);
- JNI_ENV_PTR(env)->SetStaticObjectField(JNI_ENV_ARG(env, cls),
- watches[8].fid, watches[8].val.l);
- JNI_ENV_PTR(env)->SetStaticObjectField(JNI_ENV_ARG(env, cls),
- watches[9].fid, watches[9].val.l);
+ env->SetStaticBooleanField(cls, watches[0].fid, watches[0].val.z);
+ env->SetStaticByteField(cls, watches[1].fid, watches[1].val.b);
+ env->SetStaticShortField(cls, watches[2].fid, watches[2].val.s);
+ env->SetStaticIntField(cls, watches[3].fid, watches[3].val.i);
+ env->SetStaticLongField(cls, watches[4].fid, watches[4].val.j);
+ env->SetStaticFloatField(cls, watches[5].fid, watches[5].val.f);
+ env->SetStaticDoubleField(cls, watches[6].fid, watches[6].val.d);
+ env->SetStaticCharField(cls, watches[7].fid, watches[7].val.c);
+ env->SetStaticObjectField(cls, watches[8].fid, watches[8].val.l);
+ env->SetStaticObjectField(cls, watches[9].fid, watches[9].val.l);
- JNI_ENV_PTR(env)->SetBooleanField(JNI_ENV_ARG(env, obj),
- watches[10].fid, watches[10].val.z);
- JNI_ENV_PTR(env)->SetByteField(JNI_ENV_ARG(env, obj),
- watches[11].fid, watches[11].val.b);
- JNI_ENV_PTR(env)->SetShortField(JNI_ENV_ARG(env, obj),
- watches[12].fid, watches[12].val.s);
- JNI_ENV_PTR(env)->SetIntField(JNI_ENV_ARG(env, obj),
- watches[13].fid, watches[13].val.i);
- JNI_ENV_PTR(env)->SetLongField(JNI_ENV_ARG(env, obj),
- watches[14].fid, watches[14].val.j);
- JNI_ENV_PTR(env)->SetFloatField(JNI_ENV_ARG(env, obj),
- watches[15].fid, watches[15].val.f);
- JNI_ENV_PTR(env)->SetDoubleField(JNI_ENV_ARG(env, obj),
- watches[16].fid, watches[16].val.d);
- JNI_ENV_PTR(env)->SetCharField(JNI_ENV_ARG(env, obj),
- watches[17].fid, watches[17].val.c);
- JNI_ENV_PTR(env)->SetObjectField(JNI_ENV_ARG(env, obj),
- watches[18].fid, watches[18].val.l);
- JNI_ENV_PTR(env)->SetObjectField(JNI_ENV_ARG(env, obj),
- watches[19].fid, watches[19].val.l);
+ env->SetBooleanField(obj, watches[10].fid, watches[10].val.z);
+ env->SetByteField(obj, watches[11].fid, watches[11].val.b);
+ env->SetShortField(obj, watches[12].fid, watches[12].val.s);
+ env->SetIntField(obj, watches[13].fid, watches[13].val.i);
+ env->SetLongField(obj, watches[14].fid, watches[14].val.j);
+ env->SetFloatField(obj, watches[15].fid, watches[15].val.f);
+ env->SetDoubleField(obj, watches[16].fid, watches[16].val.d);
+ env->SetCharField(obj, watches[17].fid, watches[17].val.c);
+ env->SetObjectField(obj, watches[18].fid, watches[18].val.l);
+ env->SetObjectField(obj, watches[19].fid, watches[19].val.l);
if (printdump == JNI_TRUE) {
printf(">>> ... done\n");
@@ -547,6 +502,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FramePop/framepop001/framepop001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FramePop/framepop001/framepop001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -188,8 +175,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -249,8 +235,7 @@
return result;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
- "chain", "()V");
+ mid = env->GetStaticMethodID(cls, "chain", "()V");
if (mid == 0) {
printf("Cannot find Method ID for method chain\n");
return STATUS_FAILED;
@@ -276,20 +261,18 @@
result = STATUS_FAILED;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/FramePop/framepop001a"));
+ clz = env->FindClass("nsk/jvmti/FramePop/framepop001a");
if (clz == NULL) {
printf("Cannot find framepop001a class!\n");
result = STATUS_FAILED;
return STATUS_FAILED;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, clz),
- "dummy", "()V");
+ mid = env->GetStaticMethodID(clz, "dummy", "()V");
if (mid == 0) {
printf("Cannot find Method ID for method dummy\n");
return STATUS_FAILED;
}
- JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, clz), mid);
+ env->CallStaticVoidMethod(clz, mid);
if (eventsCount != eventsExpected) {
printf("Wrong number of frame pop events: %" PRIuPTR ", expected: %" PRIuPTR "\n",
@@ -300,6 +283,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FramePop/framepop002/framepop002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/FramePop/framepop002/framepop002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -29,21 +29,8 @@
#include "JVMTITools.h"
#include "jvmti_tools.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
@@ -139,8 +126,7 @@
int i, count = 0;
for (i = 0; i < thr_count; i++) {
- if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, threads[i].thread),
- thr) == JNI_TRUE) {
+ if (env->IsSameObject(threads[i].thread, thr)) {
break;
}
}
@@ -184,8 +170,7 @@
int i;
for (i = 0; i < thr_count; i++) {
- if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, threads[i].thread),
- thr) == JNI_TRUE) {
+ if (env->IsSameObject(threads[i].thread, thr)) {
break;
}
}
@@ -332,8 +317,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -436,6 +420,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab001/getjniftab001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab001/getjniftab001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -34,15 +34,6 @@
extern "C" {
-
-#ifndef JNI_ENV_ARG1
- #ifdef __cplusplus
- #define JNI_ENV_ARG1(x)
- #else
- #define JNI_ENV_ARG1(x) x
- #endif
-#endif
-
#define PASSED 0
#define STATUS_FAILED 2
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab002/getjniftab002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab002/getjniftab002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -29,15 +29,6 @@
extern "C" {
-
-#ifndef JNI_ENV_ARG1
- #ifdef __cplusplus
- #define JNI_ENV_ARG1(x)
- #else
- #define JNI_ENV_ARG1(x) x
- #endif
-#endif
-
#define PASSED 0
#define STATUS_FAILED 2
@@ -89,7 +80,7 @@
only since JDK 1.2 */
if (verbose)
printf("\nb) Checking the function with the detached thread ...\n\ndetaching the main thread ...\n");
- if ((err = vm->DetachCurrentThread(JNI_ENV_ARG1(vm))) != 0)
+ if ((err = vm->DetachCurrentThread()) != 0)
printf("(%s,%d): Warning: DetachCurrentThread() returns: %d\n\
\tcheck with the detached main thread skipped\n",
__FILE__, __LINE__, err);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd002/intrpthrd002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd002/intrpthrd002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -65,8 +52,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -124,6 +110,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/intrpthrd003.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/intrpthrd003.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -66,8 +53,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -140,6 +126,4 @@
return JNI_FALSE;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsArrayClass/isarray004/isarray004.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsArrayClass/isarray004/isarray004.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -115,6 +101,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsArrayClass/isarray005/isarray005.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsArrayClass/isarray005/isarray005.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -125,6 +111,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin002/isfldsin002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin002/isfldsin002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -70,8 +57,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -116,7 +102,7 @@
return STATUS_FAILED;
}
- fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls), "fld", "I");
+ fid = env->GetFieldID(cls, "fld", "I");
if (fid == NULL) {
printf("Cannot get field ID!\n");
return STATUS_FAILED;
@@ -168,6 +154,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin003/isfldsin003.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin003/isfldsin003.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -28,21 +28,8 @@
#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
@@ -81,15 +68,7 @@
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 result of a valid call to GetEnv!\n");
- return JNI_ERR;
- }
-
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -141,8 +120,7 @@
}
for (i = 0; i < sizeof(fields) / sizeof(field_info); i++) {
- fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, clazz),
- fields[i].name, fields[i].sig);
+ fid = env->GetFieldID(clazz, fields[i].name, fields[i].sig);
if (fid == NULL) {
printf("(%" PRIuPTR ") cannot get field ID for %s:\"%s\"\n",
i, fields[i].name, fields[i].sig);
@@ -175,6 +153,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsInterface/isintrf004/isintrf004.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsInterface/isintrf004/isintrf004.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -115,6 +101,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsInterface/isintrf005/isintrf005.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsInterface/isintrf005/isintrf005.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -123,6 +109,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodNative/isnative001/isnative001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodNative/isnative001/isnative001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -89,9 +75,9 @@
jboolean is_native;
if (stat) {
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl), name, sig);
+ mid = env->GetStaticMethodID(cl, name, sig);
} else {
- mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
+ mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Cannot find MethodID for \"%s%s\"\n", name, sig);
@@ -129,8 +115,7 @@
checkMeth(env, cls, "nmeth", "()V", 0, JNI_TRUE);
checkMeth(env, cls, "check", "()I", 1, JNI_TRUE);
- clsId = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/IsMethodNative/isnative001$Inn"));
+ clsId = env->FindClass("nsk/jvmti/IsMethodNative/isnative001$Inn");
if (clsId == NULL) {
printf("Cannot find nsk.jvmti.IsMethodNative.isnative001$Inn class!\n");
return STATUS_FAILED;
@@ -141,6 +126,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodNative/isnative002/isnative002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodNative/isnative002/isnative002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -68,8 +55,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -89,8 +75,7 @@
return STATUS_FAILED;
}
- mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
- "<init>", "()V");
+ mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID!\n");
return STATUS_FAILED;
@@ -123,6 +108,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth001/issynth001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth001/issynth001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -93,8 +80,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -149,11 +135,9 @@
cl = ((methods[i].class_id == 1) ? cls1 :
((methods[i].class_id == 2) ? cls2 : cls3));
if (methods[i].is_static == JNI_TRUE) {
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl),
- methods[i].name, methods[i].signature);
+ mid = env->GetStaticMethodID(cl, methods[i].name, methods[i].signature);
} else {
- mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl),
- methods[i].name, methods[i].signature);
+ mid = env->GetMethodID(cl, methods[i].name, methods[i].signature);
}
if (mid == NULL) {
printf("Cannot find MethodID for \"%s%s\"\n",
@@ -190,6 +174,4 @@
Java_nsk_jvmti_IsMethodSynthetic_issynth001a_nmeth(JNIEnv *env, jclass cls) {
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth002/issynth002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth002/issynth002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -70,8 +57,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -116,8 +102,7 @@
return STATUS_FAILED;
}
- mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
- "<init>", "()V");
+ mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot find method \"<init>()V\"!\n");
return STATUS_FAILED;
@@ -156,6 +141,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodEntry/mentry001/mentry001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodEntry/mentry001/mentry001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -29,21 +29,7 @@
#include "jni_tools.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
@@ -170,8 +156,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -240,14 +225,13 @@
Java_nsk_jvmti_MethodEntry_mentry001_check(JNIEnv *env, jclass cls) {
jmethodID mid;
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
- "dummy", "()V");
+ mid = env->GetStaticMethodID(cls, "dummy", "()V");
if (mid == NULL) {
printf("Cannot find metod \"dummy()\"!\n");
return STATUS_FAILED;
}
- JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, cls), mid);
+ env->CallStaticVoidMethod(cls, mid);
if (eventsCount != eventsExpected) {
printf("Wrong number of MethodEntry events: %" PRIuPTR ", expected: %" PRIuPTR "\n",
eventsCount, eventsExpected);
@@ -279,6 +263,4 @@
}
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodEntry/mentry002/mentry002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodEntry/mentry002/mentry002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -91,8 +78,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -150,8 +136,7 @@
return;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
- "emptyMethod", "()V");
+ mid = env->GetStaticMethodID(cls, "emptyMethod", "()V");
if (mid == NULL) {
printf("Cannot find Method ID for emptyMethod\n");
result = STATUS_FAILED;
@@ -198,6 +183,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodExit/mexit001/mexit001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodExit/mexit001/mexit001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -29,21 +29,8 @@
#include "jni_tools.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
@@ -172,8 +159,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -252,21 +238,19 @@
return result;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/MethodExit/mexit001a"));
+ clz = env->FindClass("nsk/jvmti/MethodExit/mexit001a");
if (clz == NULL) {
printf("Cannot find nsk.jvmti.MethodExit.mexit001a class!\n");
return STATUS_FAILED;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, clz),
- "dummy", "()V");
+ mid = env->GetStaticMethodID(clz, "dummy", "()V");
if (mid == NULL) {
printf("Cannot find metod \"dummy()\"!\n");
return STATUS_FAILED;
}
- JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, clz), mid);
+ env->CallStaticVoidMethod(clz, mid);
err = jvmti->SetEventNotificationMode(JVMTI_DISABLE,
JVMTI_EVENT_METHOD_EXIT, NULL);
@@ -289,6 +273,4 @@
printf("Executing chain()\n");
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodExit/mexit002/mexit002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/MethodExit/mexit002/mexit002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -29,21 +29,8 @@
#include "jni_tools.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
@@ -172,8 +159,7 @@
printdump = JNI_TRUE;
}
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -230,15 +216,13 @@
return result;
}
- clz = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/MethodExit/mexit002a"));
+ clz = env->FindClass("nsk/jvmti/MethodExit/mexit002a");
if (clz == NULL) {
printf("Failed to find class \"mexit002a\"!\n");
return STATUS_FAILED;
}
- mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, clz),
- "dummy", "()V");
+ mid = env->GetStaticMethodID(clz, "dummy", "()V");
if (mid == NULL) {
printf("Failed to get method \"dummy\"!\n");
return STATUS_FAILED;
@@ -254,7 +238,7 @@
result = STATUS_FAILED;
}
- JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, clz), mid);
+ env->CallStaticVoidMethod(clz, mid);
err = jvmti->SetEventNotificationMode(JVMTI_DISABLE,
JVMTI_EVENT_METHOD_EXIT, NULL);
@@ -279,6 +263,4 @@
}
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NotifyFramePop/nframepop001/nframepop001.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NotifyFramePop/nframepop001/nframepop001.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -63,8 +50,7 @@
jmethodID method, jboolean wasPopedByException) {
jvmtiError err;
- popThread = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG((JNIEnv *)env,
- thread));
+ popThread = env->NewGlobalRef(thread);
err = jvmti_env->GetMethodDeclaringClass(method, &popClass);
if (err != JVMTI_ERROR_NONE) {
@@ -72,8 +58,7 @@
TranslateError(err), err);
result = STATUS_FAILED;
}
- popClass = (jclass) JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG((JNIEnv *)env,
- popClass));
+ popClass = (jclass) env->NewGlobalRef(popClass);
popMethod = method;
popFlag = wasPopedByException;
@@ -95,8 +80,7 @@
jvmtiError err;
if (method == mid1 || method == mid2) {
- currThread = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG((JNIEnv *)env,
- thread));
+ currThread = env->NewGlobalRef(thread);
err = jvmti_env->GetMethodDeclaringClass(
method, &currClass);
@@ -105,8 +89,7 @@
TranslateError(err), err);
result = STATUS_FAILED;
}
- currClass = (jclass) JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG((JNIEnv *)env,
- currClass));
+ currClass = (jclass) env->NewGlobalRef(currClass);
currMethod = method;
@@ -147,8 +130,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -215,16 +197,14 @@
}
}
- mid1 = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl),
- "meth01", "(I)V");
+ mid1 = env->GetMethodID(cl, "meth01", "(I)V");
if (mid1 == NULL) {
printf("Cannot find method \"meth01\"\n");
result = STATUS_FAILED;
return;
}
- mid2 = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl),
- "meth02", "(I)V");
+ mid2 = env->GetMethodID(cl, "meth02", "(I)V");
if (mid2 == NULL) {
printf("Cannot find method \"meth02\"\n");
result = STATUS_FAILED;
@@ -259,19 +239,17 @@
result = STATUS_FAILED;
}
- currThread = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env, thr));
+ currThread = env->NewGlobalRef(thr);
- currClass = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
- "nsk/jvmti/NotifyFramePop/nframepop001a"));
+ currClass = env->FindClass("nsk/jvmti/NotifyFramePop/nframepop001a");
if (currClass == NULL) {
printf("Cannot find nsk.jvmti.NotifyFramePop.nframepop001a class!\n");
result = STATUS_FAILED;
return;
}
- currClass = (jclass) JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env, currClass));
+ currClass = (jclass) env->NewGlobalRef(currClass);
- currMethod = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, currClass),
- "run", "()V");
+ currMethod = env->GetMethodID(currClass, "run", "()V");
if (currMethod == NULL) {
printf("Cannot find method \"run\"\n");
result = STATUS_FAILED;
@@ -310,14 +288,12 @@
return;
}
- if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, currThread),
- popThread) != JNI_TRUE) {
+ if (!env->IsSameObject(currThread, popThread)) {
printf("Point %d: thread is not the same as expected\n", point);
result = STATUS_FAILED;
}
- if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, currClass),
- popClass) != JNI_TRUE) {
+ if (!env->IsSameObject(currClass, popClass)) {
printf("Point %d: class is not the same as expected\n", point);
result = STATUS_FAILED;
}
@@ -352,6 +328,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NotifyFramePop/nframepop002/nframepop002.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NotifyFramePop/nframepop002/nframepop002.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -65,8 +52,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -123,6 +109,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NotifyFramePop/nframepop003/nframepop003.cpp Tue Sep 11 09:42:27 2018 -0400
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/NotifyFramePop/nframepop003/nframepop003.cpp Tue Sep 11 10:12:50 2018 -0700
@@ -27,21 +27,8 @@
#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
@@ -65,8 +52,7 @@
jint res;
jvmtiError err;
- res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
- JVMTI_VERSION_1_1);
+ res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@@ -133,6 +119,4 @@
return result;
}
-#ifdef __cplusplus
}
-#endif