< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst001/suspendthrdlst001.cpp
Print this page
rev 52185 : [mq]: refactor
@@ -60,21 +60,19 @@
jthread* threads = NULL;
jvmtiError* results = NULL;
int i;
NSK_DISPLAY1("Allocate threads array: %d threads\n", threadsCount);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jthread)),
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jthread)),
(unsigned char**)&threads))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1(" ... allocated array: %p\n", (void*)threads);
NSK_DISPLAY1("Allocate results array: %d threads\n", threadsCount);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(Allocate, jvmti, (threadsCount * sizeof(jvmtiError)),
+ if (!NSK_JVMTI_VERIFY(jvmti->Allocate((threadsCount * sizeof(jvmtiError)),
(unsigned char**)&results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY1(" ... allocated array: %p\n", (void*)threads);
@@ -82,12 +80,11 @@
NSK_DISPLAY1("Find threads: %d threads\n", threadsCount);
if (!NSK_VERIFY(fillThreadsByName(jvmti, jni, THREAD_NAME, threadsCount, threads)))
return;
NSK_DISPLAY0("Suspend threads list\n");
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(SuspendThreadList, jvmti, threadsCount, threads, results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->SuspendThreadList(threadsCount, threads, results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Check threads results:\n");
@@ -105,12 +102,11 @@
NSK_DISPLAY0("Get state vector for each thread\n");
for (i = 0; i < threadsCount; i++) {
jint state = 0;
NSK_DISPLAY2(" thread #%d (%p):\n", i, (void*)threads[i]);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadState, jvmti, threads[i], &state))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(threads[i], &state))) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY2(" ... got state vector: %s (%d)\n",
TranslateState(state), (int)state);
@@ -121,12 +117,11 @@
nsk_jvmti_setFailStatus();
}
}
NSK_DISPLAY0("Resume threads list\n");
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB4(ResumeThreadList, jvmti, threadsCount, threads, results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->ResumeThreadList(threadsCount, threads, results))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY0("Wait for thread to finish\n");
@@ -134,22 +129,20 @@
return;
NSK_DISPLAY0("Delete threads references\n");
for (i = 0; i < threadsCount; i++) {
if (threads[i] != NULL)
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threads[i]));
+ NSK_TRACE(jni->DeleteGlobalRef(threads[i]));
}
NSK_DISPLAY1("Deallocate threads array: %p\n", (void*)threads);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
nsk_jvmti_setFailStatus();
}
NSK_DISPLAY1("Deallocate results array: %p\n", (void*)results);
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)results))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)results))) {
nsk_jvmti_setFailStatus();
}
}
NSK_DISPLAY0("Let debugee to finish\n");
@@ -171,22 +164,20 @@
for (i = 0; i < foundCount; i++) {
foundThreads[i] = NULL;
}
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &count, &threads))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&count, &threads))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
found = 0;
for (i = 0; i < count; i++) {
jvmtiThreadInfo info;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info))) {
nsk_jvmti_setFailStatus();
break;
}
if (info.name != NULL && strncmp(name, info.name, len) == 0) {
@@ -197,12 +188,11 @@
found++;
}
}
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
if (found != foundCount) {
@@ -216,11 +206,11 @@
}
NSK_DISPLAY1("Make global references for threads: %d threads\n", foundCount);
for (i = 0; i < foundCount; i++) {
if (!NSK_JNI_VERIFY(jni, (foundThreads[i] = (jthread)
- NSK_CPP_STUB2(NewGlobalRef, jni, foundThreads[i])) != NULL)) {
+ jni->NewGlobalRef(foundThreads[i])) != NULL)) {
nsk_jvmti_setFailStatus();
return NSK_FALSE;
}
NSK_DISPLAY2(" ... thread #%d: %p\n", i, foundThreads[i]);
}
@@ -264,12 +254,11 @@
/* add specific capabilities for suspending thread */
{
jvmtiCapabilities suspendCaps;
memset(&suspendCaps, 0, sizeof(suspendCaps));
suspendCaps.can_suspend = 1;
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(AddCapabilities, jvmti, &suspendCaps)))
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&suspendCaps)))
return JNI_ERR;
}
/* register agent proc and arg */
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
< prev index next >