< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM07/em07t002/em07t002.cpp
Print this page
rev 52050 : [mq]: refactor
*** 61,73 ****
const jvmtiAddrLocationMap* map, const void* compile_info) {
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)) {
--- 61,71 ----
const jvmtiAddrLocationMap* map, const void* compile_info) {
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)) {
*** 84,115 ****
free((void *)rec);
} else {
NSK_DISPLAY0(">>>JVMTI_EVENT_COMPILED_METHOD_LOAD received for\n");
NSK_DISPLAY1("\t\tmethod: %s\n", rec->name);
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
methodLoadCount++;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
}
}
! 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
--- 82,110 ----
free((void *)rec);
} else {
NSK_DISPLAY0(">>>JVMTI_EVENT_COMPILED_METHOD_LOAD received for\n");
NSK_DISPLAY1("\t\tmethod: %s\n", rec->name);
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
nsk_jvmti_setFailStatus();
methodLoadCount++;
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
nsk_jvmti_setFailStatus();
}
}
! 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
*** 125,140 ****
rec = (nsk_jvmti_CompiledMethod *)nsk_list_get(plist, i);
if ((rec->code_addr == code_addr) && (rec->method == method)) {
NSK_DISPLAY0(">>>JVMTI_EVENT_COMPILED_METHOD_UNLOAD received for\n");
NSK_DISPLAY1("\t\tmethod: %s\n", rec->name);
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
methodUnloadCount++;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
free(rec);
nsk_list_remove(plist, i);
return;
--- 120,135 ----
rec = (nsk_jvmti_CompiledMethod *)nsk_list_get(plist, i);
if ((rec->code_addr == code_addr) && (rec->method == method)) {
NSK_DISPLAY0(">>>JVMTI_EVENT_COMPILED_METHOD_UNLOAD received for\n");
NSK_DISPLAY1("\t\tmethod: %s\n", rec->name);
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
nsk_jvmti_setFailStatus();
methodUnloadCount++;
! if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
nsk_jvmti_setFailStatus();
free(rec);
nsk_list_remove(plist, i);
return;
*** 146,158 ****
/* ============================================================================= */
static int
enableEvent(jvmtiEventMode enable, jvmtiEvent event) {
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB4(SetEventNotificationMode, jvmti, enable,
! event, NULL))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
return NSK_TRUE;
--- 141,151 ----
/* ============================================================================= */
static int
enableEvent(jvmtiEventMode enable, jvmtiEvent event) {
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(enable, event, NULL))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
return NSK_TRUE;
*** 189,201 ****
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.CompiledMethodLoad = cbCompiledMethodLoad;
eventCallbacks.CompiledMethodUnload = cbCompiledMethodUnload;
! return NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, jvmti,
! &eventCallbacks,
! sizeof(eventCallbacks)));
}
/* ============================================================================= */
/** Agent algorithm. */
--- 182,192 ----
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
eventCallbacks.CompiledMethodLoad = cbCompiledMethodLoad;
eventCallbacks.CompiledMethodUnload = cbCompiledMethodUnload;
! return NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)));
}
/* ============================================================================= */
/** Agent algorithm. */
*** 228,239 ****
count = nsk_list_getCount(plist);
}
}
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
nsk_jvmti_setFailStatus();
}
/* ============================================================================= */
--- 219,229 ----
count = nsk_list_getCount(plist);
}
}
! if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
nsk_jvmti_setFailStatus();
}
/* ============================================================================= */
*** 258,269 ****
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 (!NSK_VERIFY((plist = (const void *)nsk_list_create()) != NULL))
--- 248,258 ----
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 (!NSK_VERIFY((plist = (const void *)nsk_list_create()) != NULL))
*** 272,282 ****
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_compiled_method_load_events = 1;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps)))
return JNI_ERR;
}
if (!setCallBacks()) {
return JNI_ERR;
--- 261,271 ----
{
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_generate_compiled_method_load_events = 1;
! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
return JNI_ERR;
}
if (!setCallBacks()) {
return JNI_ERR;
< prev index next >