< prev index next >

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

Print this page
rev 52050 : [mq]: refactor

*** 131,146 **** } 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(); } /* ============================================================================= */ --- 131,146 ---- } 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(); } /* ============================================================================= */
*** 156,167 **** 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 --- 156,166 ---- 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
*** 182,215 **** jmethodID method, jlocation location) { 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)) { 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))) { 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 --- 181,209 ---- jmethodID method, jlocation location) { 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)) { NSK_DISPLAY2("\tMethod: %s, location: %lld\n", name, location); changeCount(JVMTI_EVENT_SINGLE_STEP, &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
*** 217,250 **** jmethodID method, jlocation location) { 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)) { 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))) { 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 --- 211,239 ---- jmethodID method, jlocation location) { 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)) { NSK_DISPLAY2("\tMethod: %s, location: %lld\n", name, location); changeCount(JVMTI_EVENT_SINGLE_STEP, &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
*** 366,385 **** 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))) { 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; } } --- 355,371 ---- 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, ! 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; } }
*** 475,488 **** eventCallbacks.VMDeath = cbVMDeath; break; } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(SetEventCallbacks, jvmti, ! &eventCallbacks, ! sizeof(eventCallbacks)))) return NSK_FALSE; return NSK_TRUE; } --- 461,471 ---- eventCallbacks.VMDeath = cbVMDeath; break; } ! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) return NSK_FALSE; return NSK_TRUE; }
*** 539,560 **** 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_single_step_events = 1; ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) return JNI_ERR; } if (!setCallBacks(1)) { return JNI_ERR; --- 522,542 ---- 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_single_step_events = 1; ! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) return JNI_ERR; } if (!setCallBacks(1)) { return JNI_ERR;
< prev index next >