< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t007/em02t007.cpp
Print this page
rev 52050 : [mq]: refactor
@@ -131,16 +131,16 @@
}
static void
changeCount(jvmtiEvent event, int *currentCounts) {
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
nsk_jvmti_setFailStatus();
currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
nsk_jvmti_setFailStatus();
}
/* ============================================================================= */
@@ -156,12 +156,11 @@
changeCount(JVMTI_EVENT_VM_DEATH, &newEventCount[0]);
showEventStatistics(STEP_NUMBER);
if (!checkEvents(STEP_NUMBER))
nsk_jvmti_setFailStatus();
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+ if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
nsk_jvmti_setFailStatus();
}
void JNICALL
@@ -182,34 +181,29 @@
jmethodID method, jlocation location) {
char *name;
char *sign;
char *genc;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB5(
- GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
nsk_jvmti_setFailStatus();
return;
}
if (!strncmp(name,"javaMethod", 8)) {
NSK_DISPLAY2("\tMethod: %s, location: %lld\n",
name, location);
changeCount(JVMTI_EVENT_SINGLE_STEP, &eventCount[0]);
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
- jvmti_env, (unsigned char*)name))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
nsk_jvmti_setFailStatus();
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
- jvmti_env, (unsigned char*)sign))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
nsk_jvmti_setFailStatus();
}
if (genc != NULL)
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
- jvmti_env, (unsigned char*)genc))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
nsk_jvmti_setFailStatus();
}
}
void JNICALL
@@ -217,34 +211,29 @@
jmethodID method, jlocation location) {
char *name;
char *sign;
char *genc;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB5(
- GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
nsk_jvmti_setFailStatus();
return;
}
if (!strncmp(name,"javaMethod", 8)) {
NSK_DISPLAY2("\tMethod: %s, location: %lld\n",
name, location);
changeCount(JVMTI_EVENT_SINGLE_STEP, &newEventCount[0]);
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
- jvmti_env, (unsigned char*)name))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
nsk_jvmti_setFailStatus();
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
- jvmti_env, (unsigned char*)sign))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
nsk_jvmti_setFailStatus();
}
if (genc != NULL)
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
- jvmti_env, (unsigned char*)genc))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
nsk_jvmti_setFailStatus();
}
}
void JNICALL
@@ -366,20 +355,17 @@
static int enableEvent(jvmtiEvent event) {
if (nsk_jvmti_isOptionalEvent(event)
&& (event != JVMTI_EVENT_SINGLE_STEP)) {
if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
- NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
- JVMTI_ENABLE, event, NULL))) {
+ jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
NSK_COMPLAIN1("Unexpected error enabling %s\n",
TranslateEvent(event));
return NSK_FALSE;
}
} else {
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
- JVMTI_ENABLE, event, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
NSK_COMPLAIN1("Unexpected error enabling %s\n",
TranslateEvent(event));
return NSK_FALSE;
}
}
@@ -475,14 +461,11 @@
eventCallbacks.VMDeath = cbVMDeath;
break;
}
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(SetEventCallbacks, jvmti,
- &eventCallbacks,
- sizeof(eventCallbacks))))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return NSK_FALSE;
return NSK_TRUE;
}
@@ -539,22 +522,21 @@
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
return JNI_ERR;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
nsk_jvmti_setFailStatus();
return JNI_ERR;
}
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_single_step_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
}
if (!setCallBacks(1)) {
return JNI_ERR;
< prev index next >