< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM07/em07t001/em07t001.cpp
Print this page
rev 52050 : [mq]: refactor
*** 62,77 ****
/* ========================================================================== */
void changeCount(jvmtiEvent event) {
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
eventCount[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
}
/* ============================================================================= */
--- 62,77 ----
/* ========================================================================== */
void changeCount(jvmtiEvent event) {
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
nsk_jvmti_setFailStatus();
eventCount[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
nsk_jvmti_setFailStatus();
}
/* ============================================================================= */
*** 85,96 ****
JNIEXPORT void JNICALL
cbVMDeath(jvmtiEnv* jvmti, JNIEnv* jni_env) {
changeCount(JVMTI_EVENT_VM_DEATH);
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
}
void JNICALL
--- 85,95 ----
JNIEXPORT void JNICALL
cbVMDeath(jvmtiEnv* jvmti, JNIEnv* jni_env) {
changeCount(JVMTI_EVENT_VM_DEATH);
! if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
nsk_jvmti_setFailStatus();
}
void JNICALL
*** 232,243 ****
/* enabling optional events */
for (i = 0; i < JVMTI_EVENT_COUNT; i++) {
jvmtiEvent event = (jvmtiEvent)(i + JVMTI_MIN_EVENT_TYPE_VAL);
if (nsk_jvmti_isOptionalEvent(event))
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));
result = NSK_FALSE;
}
}
--- 231,241 ----
/* enabling optional events */
for (i = 0; i < JVMTI_EVENT_COUNT; i++) {
jvmtiEvent event = (jvmtiEvent)(i + JVMTI_MIN_EVENT_TYPE_VAL);
if (nsk_jvmti_isOptionalEvent(event))
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));
result = NSK_FALSE;
}
}
*** 307,320 ****
eventCallbacks.GarbageCollectionStart = cbGarbageCollectionStart;
eventCallbacks.GarbageCollectionFinish = cbGarbageCollectionFinish;
eventCallbacks.ObjectFree = cbObjectFree;
eventCallbacks.VMObjectAlloc = cbVMObjectAlloc;
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB3(SetEventCallbacks, jvmti,
! &eventCallbacks,
! sizeof(eventCallbacks))))
return NSK_FALSE;
return NSK_TRUE;
}
--- 305,315 ----
eventCallbacks.GarbageCollectionStart = cbGarbageCollectionStart;
eventCallbacks.GarbageCollectionFinish = cbGarbageCollectionFinish;
eventCallbacks.ObjectFree = cbObjectFree;
eventCallbacks.VMObjectAlloc = cbVMObjectAlloc;
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
return NSK_FALSE;
return NSK_TRUE;
}
*** 361,372 ****
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;
}
if (!setCallBacks(jvmti)) {
--- 356,366 ----
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;
}
if (!setCallBacks(jvmti)) {
< prev index next >