< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/ma08t001a.cpp
Print this page
rev 52100 : 8212082: Remove the NSK_CPP_STUB macros for remaining vmTestbase/jvmti/[sS]*
Summary:
Reviewed-by:
@@ -54,18 +54,16 @@
jmethodID method, jlocation location, jobject exception,
jmethodID catch_method, jlocation catch_location) {
jclass klass = NULL;
char *signature = NULL;
- if (!NSK_JNI_VERIFY(jni_env, (klass =
- NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
+ if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
- klass, &signature, NULL))) {
+ if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
if (!NSK_VERIFY(signature != NULL)) {
@@ -73,29 +71,29 @@
return;
}
NSK_DISPLAY1("Exception event: %s\n", signature);
- if (NSK_CPP_STUB3(IsSameObject, jni_env, threadForInterrupt, thread)) {
+ if (jni_env->IsSameObject(threadForInterrupt, thread)) {
if (strcmp(signature, INTERRUPTED_EXCEPTION_CLASS_SIG) == 0) {
InterruptedExceptionFlag++;
} else {
NSK_COMPLAIN1("Unexpected exception in DebuggeeThreadForInterrupt: %s\n",
signature);
nsk_jvmti_setFailStatus();
}
- } else if (NSK_CPP_STUB3(IsSameObject, jni_env, threadForStop, thread)) {
+ } else if (jni_env->IsSameObject(threadForStop, thread)) {
if (strcmp(signature, THREAD_DEATH_CLASS_SIG) == 0) {
ThreadDeathFlag++;
} else {
NSK_COMPLAIN1("Unexpected exception in DebuggeeThreadForStop: %s\n",
signature);
nsk_jvmti_setFailStatus();
}
}
- NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
+ jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
@@ -107,12 +105,11 @@
int i;
NSK_DISPLAY0("Prepare: find tested thread\n");
/* get all live threads */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads)))
return NSK_FALSE;
if (!NSK_VERIFY(threads_count > 0 && threads != NULL))
return NSK_FALSE;
@@ -120,12 +117,11 @@
for (i = 0; i < threads_count; i++) {
if (!NSK_VERIFY(threads[i] != NULL))
return NSK_FALSE;
/* get thread information */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info)))
+ if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info)))
return NSK_FALSE;
NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]);
/* find by name */
@@ -137,12 +133,11 @@
}
}
}
/* deallocate threads list */
- if (!NSK_JVMTI_VERIFY(
- NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
+ if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
if (threadForStop == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForStop not found");
return NSK_FALSE;
@@ -151,21 +146,18 @@
if (threadForInterrupt == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForInterrupt not found");
return NSK_FALSE;
}
- if (!NSK_JNI_VERIFY(jni, (threadForStop =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadForStop)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (threadForStop = jni->NewGlobalRef(threadForStop)) != NULL))
return NSK_FALSE;
- if (!NSK_JNI_VERIFY(jni, (threadForInterrupt =
- NSK_CPP_STUB2(NewGlobalRef, jni, threadForInterrupt)) != NULL))
+ if (!NSK_JNI_VERIFY(jni, (threadForInterrupt = jni->NewGlobalRef(threadForInterrupt)) != NULL))
return NSK_FALSE;
/* enable event */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
return NSK_FALSE;
return NSK_TRUE;
}
@@ -197,16 +189,15 @@
InterruptedExceptionFlag);
if (!NSK_VERIFY(InterruptedExceptionFlag))
nsk_jvmti_setFailStatus();
/* disable event */
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
- jvmti, JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
+ if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
nsk_jvmti_setFailStatus();
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadForStop));
- NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadForInterrupt));
+ NSK_TRACE(jni->DeleteGlobalRef(threadForStop));
+ NSK_TRACE(jni->DeleteGlobalRef(threadForInterrupt));
if (!nsk_jvmti_resumeSync())
return;
}
@@ -243,11 +234,11 @@
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
return JNI_ERR;
memset(&caps, 0, sizeof(caps));
caps.can_generate_exception_events = 1;
- if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+ if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.Exception = &Exception;
< prev index next >