Skip to content

Commit 1aecb28

Browse files
committed
8211899: Remove the NSK_CPP_STUB macros from vmTestbase for jvmti/scenarios/[E-M]
Remove the NSK_CPP_STUB macros from tests Backport-of: d63acb5
1 parent ccb0ed3 commit 1aecb28

File tree

50 files changed

+597
-1137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+597
-1137
lines changed

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t006/em02t006.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ JNIEXPORT jboolean JNICALL
5757
Java_nsk_jvmti_scenarios_events_EM02_em02t006_setTag(JNIEnv *env,
5858
jobject o, jobject object, jlong tag) {
5959

60-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetTag, jvmti, object, tag))) {
60+
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(object, tag))) {
6161
NSK_COMPLAIN0("TEST FAILED: unable to set tag for a tested object\n");
6262
return NSK_FALSE;
6363
}
@@ -148,12 +148,12 @@ int checkEvents(int step) {
148148
static void
149149
changeCount(jvmtiEvent event, int *currentCounts) {
150150

151-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
151+
if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
152152
nsk_jvmti_setFailStatus();
153153

154154
currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
155155

156-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
156+
if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
157157
nsk_jvmti_setFailStatus();
158158

159159
}
@@ -173,8 +173,7 @@ cbVMDeath(jvmtiEnv* jvmti, JNIEnv* jni_env) {
173173
if (!checkEvents(STEP_NUMBER))
174174
nsk_jvmti_setFailStatus();
175175

176-
if (!NSK_JVMTI_VERIFY(
177-
NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
176+
if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
178177
nsk_jvmti_setFailStatus();
179178

180179
}
@@ -329,16 +328,13 @@ static int enableEvent(jvmtiEvent event) {
329328
if (nsk_jvmti_isOptionalEvent(event)
330329
&& (event != JVMTI_EVENT_OBJECT_FREE)) {
331330
if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
332-
NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
333-
JVMTI_ENABLE, event, NULL))) {
331+
jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
334332
NSK_COMPLAIN1("Unexpected error enabling %s\n",
335333
TranslateEvent(event));
336334
return NSK_FALSE;
337335
}
338336
} else {
339-
if (!NSK_JVMTI_VERIFY(
340-
NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
341-
JVMTI_ENABLE, event, NULL))) {
337+
if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
342338
NSK_COMPLAIN1("Unexpected error enabling %s\n",
343339
TranslateEvent(event));
344340
return NSK_FALSE;
@@ -431,10 +427,7 @@ setCallBacks(int step) {
431427
break;
432428

433429
}
434-
if (!NSK_JVMTI_VERIFY(
435-
NSK_CPP_STUB3(SetEventCallbacks, jvmti,
436-
&eventCallbacks,
437-
sizeof(eventCallbacks))))
430+
if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
438431
return NSK_FALSE;
439432

440433
return NSK_TRUE;
@@ -495,8 +488,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
495488
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
496489
return JNI_ERR;
497490

498-
if (!NSK_JVMTI_VERIFY(
499-
NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
491+
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
500492
nsk_jvmti_setFailStatus();
501493
return JNI_ERR;
502494
}
@@ -507,7 +499,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
507499

508500
caps.can_tag_objects = 1;
509501
caps.can_generate_object_free_events = 1;
510-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
502+
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
511503
return JNI_ERR;
512504
}
513505

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t007/em02t007.cpp

Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ int checkEvents(int step) {
133133
static void
134134
changeCount(jvmtiEvent event, int *currentCounts) {
135135

136-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
136+
if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
137137
nsk_jvmti_setFailStatus();
138138

139139
currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
140140

141-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
141+
if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
142142
nsk_jvmti_setFailStatus();
143143

144144
}
@@ -158,8 +158,7 @@ cbVMDeath(jvmtiEnv* jvmti, JNIEnv* jni_env) {
158158
if (!checkEvents(STEP_NUMBER))
159159
nsk_jvmti_setFailStatus();
160160

161-
if (!NSK_JVMTI_VERIFY(
162-
NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
161+
if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
163162
nsk_jvmti_setFailStatus();
164163

165164
}
@@ -184,9 +183,7 @@ cbSingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
184183
char *sign;
185184
char *genc;
186185

187-
if (!NSK_JVMTI_VERIFY(
188-
NSK_CPP_STUB5(
189-
GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
186+
if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
190187
nsk_jvmti_setFailStatus();
191188
return;
192189
}
@@ -197,17 +194,14 @@ cbSingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
197194
changeCount(JVMTI_EVENT_SINGLE_STEP, &eventCount[0]);
198195
}
199196

200-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
201-
jvmti_env, (unsigned char*)name))) {
197+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
202198
nsk_jvmti_setFailStatus();
203199
}
204-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
205-
jvmti_env, (unsigned char*)sign))) {
200+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
206201
nsk_jvmti_setFailStatus();
207202
}
208203
if (genc != NULL)
209-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
210-
jvmti_env, (unsigned char*)genc))) {
204+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
211205
nsk_jvmti_setFailStatus();
212206
}
213207
}
@@ -219,9 +213,7 @@ cbNewSingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
219213
char *sign;
220214
char *genc;
221215

222-
if (!NSK_JVMTI_VERIFY(
223-
NSK_CPP_STUB5(
224-
GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
216+
if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
225217
nsk_jvmti_setFailStatus();
226218
return;
227219
}
@@ -232,17 +224,14 @@ cbNewSingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
232224
changeCount(JVMTI_EVENT_SINGLE_STEP, &newEventCount[0]);
233225
}
234226

235-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
236-
jvmti_env, (unsigned char*)name))) {
227+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
237228
nsk_jvmti_setFailStatus();
238229
}
239-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
240-
jvmti_env, (unsigned char*)sign))) {
230+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
241231
nsk_jvmti_setFailStatus();
242232
}
243233
if (genc != NULL)
244-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
245-
jvmti_env, (unsigned char*)genc))) {
234+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
246235
nsk_jvmti_setFailStatus();
247236
}
248237
}
@@ -368,16 +357,13 @@ static int enableEvent(jvmtiEvent event) {
368357
if (nsk_jvmti_isOptionalEvent(event)
369358
&& (event != JVMTI_EVENT_SINGLE_STEP)) {
370359
if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
371-
NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
372-
JVMTI_ENABLE, event, NULL))) {
360+
jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
373361
NSK_COMPLAIN1("Unexpected error enabling %s\n",
374362
TranslateEvent(event));
375363
return NSK_FALSE;
376364
}
377365
} else {
378-
if (!NSK_JVMTI_VERIFY(
379-
NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
380-
JVMTI_ENABLE, event, NULL))) {
366+
if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
381367
NSK_COMPLAIN1("Unexpected error enabling %s\n",
382368
TranslateEvent(event));
383369
return NSK_FALSE;
@@ -477,10 +463,7 @@ setCallBacks(int step) {
477463
break;
478464

479465
}
480-
if (!NSK_JVMTI_VERIFY(
481-
NSK_CPP_STUB3(SetEventCallbacks, jvmti,
482-
&eventCallbacks,
483-
sizeof(eventCallbacks))))
466+
if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
484467
return NSK_FALSE;
485468

486469
return NSK_TRUE;
@@ -541,8 +524,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
541524
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
542525
return JNI_ERR;
543526

544-
if (!NSK_JVMTI_VERIFY(
545-
NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
527+
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
546528
nsk_jvmti_setFailStatus();
547529
return JNI_ERR;
548530
}
@@ -552,7 +534,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
552534
memset(&caps, 0, sizeof(caps));
553535

554536
caps.can_generate_single_step_events = 1;
555-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
537+
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
556538
return JNI_ERR;
557539
}
558540

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t008/em02t008.cpp

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ int checkEvents(int step) {
132132
static void
133133
changeCount(jvmtiEvent event, int *currentCounts) {
134134

135-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
135+
if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
136136
nsk_jvmti_setFailStatus();
137137

138138
currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
139139

140-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
140+
if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
141141
nsk_jvmti_setFailStatus();
142142

143143
}
@@ -157,8 +157,7 @@ cbVMDeath(jvmtiEnv* jvmti, JNIEnv* jni_env) {
157157
if (!checkEvents(STEP_NUMBER))
158158
nsk_jvmti_setFailStatus();
159159

160-
if (!NSK_JVMTI_VERIFY(
161-
NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
160+
if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
162161
nsk_jvmti_setFailStatus();
163162

164163
}
@@ -170,9 +169,7 @@ cbException(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
170169

171170
jvmtiThreadInfo info_ptr;
172171

173-
if (!NSK_JVMTI_VERIFY(
174-
NSK_CPP_STUB3(
175-
GetThreadInfo, jvmti_env, thread, &info_ptr))) {
172+
if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
176173
nsk_jvmti_setFailStatus();
177174
return;
178175
}
@@ -183,8 +180,7 @@ cbException(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
183180
changeCount(JVMTI_EVENT_EXCEPTION, &eventCount[0]);
184181
}
185182

186-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
187-
jvmti_env, (unsigned char*)info_ptr.name))) {
183+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
188184
nsk_jvmti_setFailStatus();
189185
}
190186
}
@@ -196,9 +192,7 @@ cbNewException(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
196192

197193
jvmtiThreadInfo info_ptr;
198194

199-
if (!NSK_JVMTI_VERIFY(
200-
NSK_CPP_STUB3(
201-
GetThreadInfo, jvmti_env, thread, &info_ptr))) {
195+
if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
202196
nsk_jvmti_setFailStatus();
203197
return;
204198
}
@@ -209,8 +203,7 @@ cbNewException(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
209203
changeCount(JVMTI_EVENT_EXCEPTION, &newEventCount[0]);
210204
}
211205

212-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
213-
jvmti_env, (unsigned char*)info_ptr.name))) {
206+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
214207
nsk_jvmti_setFailStatus();
215208
}
216209
}
@@ -221,9 +214,7 @@ cbExceptionCatch(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
221214

222215
jvmtiThreadInfo info_ptr;
223216

224-
if (!NSK_JVMTI_VERIFY(
225-
NSK_CPP_STUB3(
226-
GetThreadInfo, jvmti_env, thread, &info_ptr))) {
217+
if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
227218
nsk_jvmti_setFailStatus();
228219
return;
229220
}
@@ -234,8 +225,7 @@ cbExceptionCatch(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
234225
changeCount(JVMTI_EVENT_EXCEPTION_CATCH, &eventCount[0]);
235226
}
236227

237-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
238-
jvmti_env, (unsigned char*)info_ptr.name))) {
228+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
239229
nsk_jvmti_setFailStatus();
240230
}
241231
}
@@ -246,9 +236,7 @@ cbNewExceptionCatch(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
246236

247237
jvmtiThreadInfo info_ptr;
248238

249-
if (!NSK_JVMTI_VERIFY(
250-
NSK_CPP_STUB3(
251-
GetThreadInfo, jvmti_env, thread, &info_ptr))) {
239+
if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
252240
nsk_jvmti_setFailStatus();
253241
return;
254242
}
@@ -259,8 +247,7 @@ cbNewExceptionCatch(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
259247
changeCount(JVMTI_EVENT_EXCEPTION_CATCH, &newEventCount[0]);
260248
}
261249

262-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
263-
jvmti_env, (unsigned char*)info_ptr.name))) {
250+
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
264251
nsk_jvmti_setFailStatus();
265252
}
266253
}
@@ -390,16 +377,13 @@ static int enableEvent(jvmtiEvent event) {
390377
&& (event != JVMTI_EVENT_EXCEPTION)
391378
&& (event != JVMTI_EVENT_EXCEPTION_CATCH)) {
392379
if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
393-
NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
394-
JVMTI_ENABLE, event, NULL))) {
380+
jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
395381
NSK_COMPLAIN1("Unexpected error enabling %s\n",
396382
TranslateEvent(event));
397383
return NSK_FALSE;
398384
}
399385
} else {
400-
if (!NSK_JVMTI_VERIFY(
401-
NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
402-
JVMTI_ENABLE, event, NULL))) {
386+
if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
403387
NSK_COMPLAIN1("Unexpected error enabling %s\n",
404388
TranslateEvent(event));
405389
return NSK_FALSE;
@@ -493,10 +477,7 @@ setCallBacks(int step) {
493477
break;
494478

495479
}
496-
if (!NSK_JVMTI_VERIFY(
497-
NSK_CPP_STUB3(SetEventCallbacks, jvmti,
498-
&eventCallbacks,
499-
sizeof(eventCallbacks))))
480+
if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
500481
return NSK_FALSE;
501482

502483
return NSK_TRUE;
@@ -555,8 +536,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
555536
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
556537
return JNI_ERR;
557538

558-
if (!NSK_JVMTI_VERIFY(
559-
NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
539+
if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
560540
nsk_jvmti_setFailStatus();
561541
return JNI_ERR;
562542
}
@@ -566,7 +546,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
566546
memset(&caps, 0, sizeof(caps));
567547

568548
caps.can_generate_exception_events = 1;
569-
if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
549+
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
570550
return JNI_ERR;
571551
}
572552

0 commit comments

Comments
 (0)