< prev index next >

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

Print this page
rev 52050 : [mq]: refactor

@@ -130,16 +130,16 @@
 }
 
 static void
 changeCount(jvmtiEvent event, int *currentCounts) {
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
         nsk_jvmti_setFailStatus();
 
     currentCounts[event - JVMTI_MIN_EVENT_TYPE_VAL]++;
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
 
 /* ============================================================================= */

@@ -155,12 +155,11 @@
     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)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
 
 void JNICALL

@@ -168,25 +167,22 @@
                 jmethodID method, jlocation location, jobject exception,
                 jmethodID catch_method, jlocation catch_location) {
 
     jvmtiThreadInfo info_ptr;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(
-                GetThreadInfo, jvmti_env, thread, &info_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     if (!strncmp(info_ptr.name,"em02t008", 8)) {
         NSK_DISPLAY1("\tThread: %s\n", info_ptr.name);
 
         changeCount(JVMTI_EVENT_EXCEPTION, &eventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)info_ptr.name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
         nsk_jvmti_setFailStatus();
     }
 }
 
 void JNICALL

@@ -194,75 +190,66 @@
                 jmethodID method, jlocation location, jobject exception,
                 jmethodID catch_method, jlocation catch_location) {
 
     jvmtiThreadInfo info_ptr;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(
-                GetThreadInfo, jvmti_env, thread, &info_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     if (!strncmp(info_ptr.name,"em02t008", 8)) {
         NSK_DISPLAY1("\tThread: %s\n", info_ptr.name);
 
         changeCount(JVMTI_EVENT_EXCEPTION, &newEventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)info_ptr.name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
         nsk_jvmti_setFailStatus();
     }
 }
 
 void JNICALL
 cbExceptionCatch(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
                 jmethodID method, jlocation location, jobject exception) {
 
     jvmtiThreadInfo info_ptr;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(
-                GetThreadInfo, jvmti_env, thread, &info_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     if (!strncmp(info_ptr.name,"em02t008", 8)) {
         NSK_DISPLAY1("\tThread: %s\n", info_ptr.name);
 
         changeCount(JVMTI_EVENT_EXCEPTION_CATCH, &eventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)info_ptr.name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
         nsk_jvmti_setFailStatus();
     }
 }
 
 void JNICALL
 cbNewExceptionCatch(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
                 jmethodID method, jlocation location, jobject exception) {
 
     jvmtiThreadInfo info_ptr;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(
-                GetThreadInfo, jvmti_env, thread, &info_ptr))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info_ptr))) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     if (!strncmp(info_ptr.name,"em02t008", 8)) {
         NSK_DISPLAY1("\tThread: %s\n", info_ptr.name);
 
         changeCount(JVMTI_EVENT_EXCEPTION_CATCH, &newEventCount[0]);
     }
 
-    if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate,
-            jvmti_env, (unsigned char*)info_ptr.name))) {
+    if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)info_ptr.name))) {
         nsk_jvmti_setFailStatus();
     }
 }
 
 void JNICALL

@@ -388,20 +375,17 @@
 
     if (nsk_jvmti_isOptionalEvent(event)
             && (event != JVMTI_EVENT_EXCEPTION)
             && (event != JVMTI_EVENT_EXCEPTION_CATCH)) {
         if (!NSK_JVMTI_VERIFY_CODE(JVMTI_ERROR_MUST_POSSESS_CAPABILITY,
-                NSK_CPP_STUB4(SetEventNotificationMode, jvmti,
-                    JVMTI_ENABLE, event, NULL))) {
+                jvmti->SetEventNotificationMode(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))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, event, NULL))) {
             NSK_COMPLAIN1("Unexpected error enabling %s\n",
                 TranslateEvent(event));
             return NSK_FALSE;
         }
     }

@@ -491,14 +475,11 @@
 
             eventCallbacks.VMDeath                   = cbVMDeath;
             break;
 
     }
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(SetEventCallbacks, jvmti,
-                                &eventCallbacks,
-                                sizeof(eventCallbacks))))
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks))))
         return NSK_FALSE;
 
     return NSK_TRUE;
 }
 

@@ -553,22 +534,21 @@
     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))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return JNI_ERR;
     }
 
     {
         jvmtiCapabilities caps;
         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;
     }
 
     if (!setCallBacks(1)) {
         return JNI_ERR;
< prev index next >