< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/extension/EX03/ex03t001/ex03t001.cpp

Print this page
rev 52050 : [mq]: refactor

@@ -59,20 +59,17 @@
     } else {
         eventReceived2 = JNI_TRUE;
     }
 
     /* Notify main agent thread */
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(RawMonitorEnter, jvmti, eventMon))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(eventMon))) {
         nsk_jvmti_setFailStatus();
     }
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(RawMonitorNotify, jvmti, eventMon))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorNotify(eventMon))) {
         nsk_jvmti_setFailStatus();
     }
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(RawMonitorExit, jvmti, eventMon))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(eventMon))) {
         nsk_jvmti_setFailStatus();
     }
 }
 
 jboolean isClassUnloadingEnabled() {

@@ -82,12 +79,11 @@
     jboolean enabled = JNI_FALSE;
     jvmtiError err;
 
     NSK_DISPLAY0("Get extension functions list\n");
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetExtensionFunctions, jvmti, &extCount, &extList))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetExtensionFunctions(&extCount, &extList))) {
         nsk_jvmti_setFailStatus();
         return JNI_FALSE;
     }
 
     for (i = 0; i < extCount; i++) {

@@ -115,22 +111,21 @@
     jint extCount, i;
     jvmtiExtensionEventInfo* extList;
     jboolean found = JNI_FALSE;
 
     NSK_DISPLAY0("Get extension events list\n");
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(GetExtensionEvents, jvmti, &extCount, &extList))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->GetExtensionEvents(&extCount, &extList))) {
         nsk_jvmti_setFailStatus();
         return JNI_FALSE;
     }
 
     for (i = 0; i < extCount; i++) {
         if (strcmp(extList[i].id, (char*)"com.sun.hotspot.events.ClassUnload") == 0) {
             found = JNI_TRUE;
 
             if (!NSK_JVMTI_VERIFY(
-                    NSK_CPP_STUB3(SetExtensionEventCallback, jvmti, extList[i].extension_event_index,
+                    jvmti->SetExtensionEventCallback(extList[i].extension_event_index,
                      enable ? (jvmtiExtensionEvent)ClassUnload : NULL ))) {
                 nsk_jvmti_setFailStatus();
                 return JNI_FALSE;
             }
             eventEnabled = enable;

@@ -173,20 +168,17 @@
         NSK_DISPLAY0("Let debugee to unload ex03t001a class.\n");
         if (!NSK_VERIFY(nsk_jvmti_resumeSync()))
             break;
 
         /* Wait for notifying from event's thread */
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(RawMonitorEnter, jvmti, eventMon))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(eventMon))) {
             nsk_jvmti_setFailStatus();
         }
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(RawMonitorWait, jvmti, eventMon, timeout))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorWait(eventMon, timeout))) {
             nsk_jvmti_setFailStatus();
         }
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(RawMonitorExit, jvmti, eventMon))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(eventMon))) {
             nsk_jvmti_setFailStatus();
         }
 
         NSK_DISPLAY0("Wait for loading of ex03t001b class.\n");
         if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout)))

@@ -200,20 +192,17 @@
         NSK_DISPLAY0("Let debugee to unload ex03t001b class.\n");
         if (!NSK_VERIFY(nsk_jvmti_resumeSync()))
             return;
 
         /* Wait during 10 secs for notifying from event's thread */
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(RawMonitorEnter, jvmti, eventMon))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(eventMon))) {
             nsk_jvmti_setFailStatus();
         }
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(RawMonitorWait, jvmti, eventMon, 10000))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorWait(eventMon, 10000))) {
             nsk_jvmti_setFailStatus();
         }
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(RawMonitorExit, jvmti, eventMon))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(eventMon))) {
             nsk_jvmti_setFailStatus();
         }
 
         if (eventReceived1 == JNI_FALSE) {
             nsk_jvmti_setFailStatus();

@@ -228,11 +217,11 @@
         if (!NSK_VERIFY(nsk_jvmti_waitForSync(timeout)))
             return;
 
     } while (0);
 
-    NSK_TRACE(NSK_CPP_STUB2(DestroyRawMonitor, jvmti, eventMon));
+    NSK_TRACE(jvmti->DestroyRawMonitor(eventMon));
 
     NSK_DISPLAY0("Let debugee to finish\n");
     if (!NSK_VERIFY(nsk_jvmti_resumeSync()))
         return;
 }

@@ -260,12 +249,11 @@
 
     if (!NSK_VERIFY((jvmti =
             nsk_jvmti_createJVMTIEnv(jvm, reserved)) != NULL))
         return JNI_ERR;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "eventMon", &eventMon))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("eventMon", &eventMon))) {
         return JNI_ERR;
     }
 
     if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
         return JNI_ERR;
< prev index next >