< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/events/EM06/em06t001/em06t001.cpp

Print this page
rev 52050 : [mq]: refactor

@@ -58,31 +58,28 @@
     jmethodID methodID;
     jclass classObject;
     jstring jclassName;
     const char *className;
 
-    if (!NSK_JNI_VERIFY(jni_env, (classObject =
-            NSK_CPP_STUB2(GetObjectClass, jni_env, klass)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni_env, (classObject = jni_env->GetObjectClass(klass)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     if (!NSK_JNI_VERIFY(jni_env, (methodID =
-            NSK_CPP_STUB4(GetMethodID, jni_env, classObject,
-                        "getName", "()Ljava/lang/String;")) != NULL)) {
+            jni_env->GetMethodID(classObject, "getName", "()Ljava/lang/String;")) != NULL)) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
-    jclassName = (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) NSK_CPP_STUB3(CallObjectMethod, jni_env, klass,
-                        methodID);
+    jclassName = (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) (jstring) jni_env->CallObjectMethod(klass, methodID);
 
-    className = NSK_CPP_STUB3(GetStringUTFChars, jni_env, jclassName, 0);
+    className = jni_env->GetStringUTFChars(jclassName, 0);
 
     if ( className != NULL && (strcmp(className, EXPECTED_CLASS_NAME)==0) ) {
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorEnter, jvmti, syncLock)))
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
             nsk_jvmti_setFailStatus();
 
         switch (event) {
             case JVMTI_EVENT_CLASS_LOAD:
                 classloadEventCount++; break;

@@ -91,16 +88,16 @@
             default:
                 NSK_COMPLAIN1("Unexpected event %s", TranslateEvent(event));
                 nsk_jvmti_setFailStatus();
         }
 
-        if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(RawMonitorExit, jvmti, syncLock)))
+        if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorExit(syncLock)))
             nsk_jvmti_setFailStatus();
 
     }
 
-    NSK_CPP_STUB3(ReleaseStringUTFChars, jni_env, jclassName, className);
+    jni_env->ReleaseStringUTFChars(jclassName, className);
 }
 
 JNIEXPORT void JNICALL
 cbClassLoad(jvmtiEnv* jvmti, JNIEnv* jni_env, jthread thread, jclass klass) {
 

@@ -115,13 +112,11 @@
 
 /* ============================================================================= */
 
 static int
 enableEvent(jvmtiEventMode enable, jvmtiEvent event) {
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB4(SetEventNotificationMode, jvmti, enable,
-                                            event, NULL))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(enable, event, NULL))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
 
     return NSK_TRUE;

@@ -170,14 +165,11 @@
     memset(&eventCallbacks, 0, sizeof(eventCallbacks));
 
     eventCallbacks.ClassLoad    = cbClassLoad;
     eventCallbacks.ClassPrepare = cbClassPrepare;
 
-    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;
 }
 

@@ -185,12 +177,11 @@
 
 /** Agent algorithm. */
 static void JNICALL
 agentProc(jvmtiEnv* jvmti, JNIEnv* agentJNI, void* arg) {
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(CreateRawMonitor, jvmti, "_syncLock", &syncLock))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->CreateRawMonitor("_syncLock", &syncLock))) {
         nsk_jvmti_setFailStatus();
         return;
     }
 
     jni = agentJNI;

@@ -229,12 +220,11 @@
 
     NSK_DISPLAY0("Let debuggee to finish\n");
     if (!nsk_jvmti_resumeSync())
         return;
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB2(DestroyRawMonitor, jvmti, syncLock)))
+    if (!NSK_JVMTI_VERIFY(jvmti->DestroyRawMonitor(syncLock)))
         nsk_jvmti_setFailStatus();
 
 }
 
 /* ============================================================================= */
< prev index next >