< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t009/em02t009.cpp
Print this page
rev 52050 : [mq]: refactor
*** 141,156 ****
}
static void
changeCount(jvmtiEvent event, int *currentCounts) {
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
}
/* ============================================================================= */
--- 141,156 ----
}
static void
changeCount(jvmtiEvent event, int *currentCounts) {
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
nsk_jvmti_setFailStatus();
currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
nsk_jvmti_setFailStatus();
}
/* ============================================================================= */
*** 166,177 ****
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)))
nsk_jvmti_setFailStatus();
}
void JNICALL
--- 166,176 ----
changeCount(JVMTI_EVENT_VM_DEATH, &newEventCount[0]);
showEventStatistics(STEP_NUMBER);
if (!checkEvents(STEP_NUMBER))
nsk_jvmti_setFailStatus();
! if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
nsk_jvmti_setFailStatus();
}
void JNICALL
*** 227,258 ****
char *name;
char *sign;
char *genc;
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB5(
! GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
nsk_jvmti_setFailStatus();
return;
}
if (!strncmp(name,"javaMethod", 8)) {
changeCount(event, &eventCount[0]);
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*)name))) {
nsk_jvmti_setFailStatus();
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*)sign))) {
nsk_jvmti_setFailStatus();
}
if (genc != NULL)
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*)genc))) {
nsk_jvmti_setFailStatus();
}
}
void JNICALL
--- 226,252 ----
char *name;
char *sign;
char *genc;
! if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
nsk_jvmti_setFailStatus();
return;
}
if (!strncmp(name,"javaMethod", 8)) {
changeCount(event, &eventCount[0]);
}
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
nsk_jvmti_setFailStatus();
}
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
nsk_jvmti_setFailStatus();
}
if (genc != NULL)
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
nsk_jvmti_setFailStatus();
}
}
void JNICALL
*** 274,305 ****
char *name;
char *sign;
char *genc;
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB5(
! GetMethodName, jvmti_env, method, &name, &sign, &genc))) {
nsk_jvmti_setFailStatus();
return;
}
if (!strncmp(name,"javaMethod", 8)) {
changeCount(event, &newEventCount[0]);
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*)name))) {
nsk_jvmti_setFailStatus();
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*)sign))) {
nsk_jvmti_setFailStatus();
}
if (genc != NULL)
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
! jvmti_env, (unsigned char*)genc))) {
nsk_jvmti_setFailStatus();
}
}
void JNICALL
--- 268,294 ----
char *name;
char *sign;
char *genc;
! if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &sign, &genc))) {
nsk_jvmti_setFailStatus();
return;
}
if (!strncmp(name,"javaMethod", 8)) {
changeCount(event, &newEventCount[0]);
}
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)name))) {
nsk_jvmti_setFailStatus();
}
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)sign))) {
nsk_jvmti_setFailStatus();
}
if (genc != NULL)
! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)genc))) {
nsk_jvmti_setFailStatus();
}
}
void JNICALL
*** 393,412 ****
if (nsk_jvmti_isOptionalEvent(event)
&& (event != JVMTI_EVENT_METHOD_ENTRY)
&& (event != JVMTI_EVENT_METHOD_EXIT)) {
if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
! NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
! 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))) {
NSK_COMPLAIN1("Unexpected error enabling %s\n",
TranslateEvent(event));
return NSK_FALSE;
}
}
--- 382,398 ----
if (nsk_jvmti_isOptionalEvent(event)
&& (event != JVMTI_EVENT_METHOD_ENTRY)
&& (event != JVMTI_EVENT_METHOD_EXIT)) {
if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
! jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
NSK_COMPLAIN1("Unexpected error enabling %s\n",
TranslateEvent(event));
return NSK_FALSE;
}
} else {
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
NSK_COMPLAIN1("Unexpected error enabling %s\n",
TranslateEvent(event));
return NSK_FALSE;
}
}
*** 496,509 ****
eventCallbacks.VMDeath = cbVMDeath;
break;
}
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(SetEventCallbacks, jvmti,
! &eventCallbacks,
! sizeof(eventCallbacks))))
return NSK_FALSE;
return NSK_TRUE;
}
--- 482,492 ----
eventCallbacks.VMDeath = cbVMDeath;
break;
}
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return NSK_FALSE;
return NSK_TRUE;
}
*** 558,580 ****
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))) {
nsk_jvmti_setFailStatus();
return JNI_ERR;
}
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_entry_events = 1;
caps.can_generate_method_exit_events = 1;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
return JNI_ERR;
}
if (!setCallBacks(1)) {
return JNI_ERR;
--- 541,562 ----
timeout = nsk_jvmti_getWaitTime() * 60 * 1000;
if (!NSK_VERIFY((jvmti = nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
return JNI_ERR;
! if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
nsk_jvmti_setFailStatus();
return JNI_ERR;
}
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_entry_events = 1;
caps.can_generate_method_exit_events = 1;
! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
}
if (!setCallBacks(1)) {
return JNI_ERR;
< prev index next >