diff test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk003/classfloadhk003.cpp @ 52064:054a24c46812

8211261: Remove the NSK_CPP_STUB macros from vmTestbase for jvmti/[A-G]* Summary: Remove the NSK_CPP_STUB macros Reviewed-by: amenkov, cjplummer
author jcbeyler
date Mon, 08 Oct 2018 13:54:43 -0700
parents 79dc492c00ab
children
line wrap: on
line diff
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk003/classfloadhk003.cpp	Mon Oct 08 11:14:59 2018 -0700
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk003/classfloadhk003.cpp	Mon Oct 08 13:54:43 2018 -0700
@@ -127,7 +127,7 @@
 
     NSK_DISPLAY1("Find static field: %s\n", fieldName);
     if (!NSK_JNI_VERIFY(jni, (fieldID =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, cls, fieldName, fieldSig)) != NULL)) {
+            jni->GetStaticFieldID(cls, fieldName, fieldSig)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -135,14 +135,13 @@
 
     NSK_DISPLAY1("Get classfile bytes array from static field: %s\n", fieldName);
     if (!NSK_JNI_VERIFY(jni, (array = (jbyteArray)
-            NSK_CPP_STUB3(GetStaticObjectField, jni, cls, fieldID)) != NULL)) {
+            jni->GetStaticObjectField(cls, fieldID)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
     NSK_DISPLAY1("  ... got array object: 0x%p\n", (void*)array);
 
-    if (!NSK_JNI_VERIFY(jni, (*size =
-            NSK_CPP_STUB2(GetArrayLength, jni, array)) > 0)) {
+    if (!NSK_JNI_VERIFY(jni, (*size = jni->GetArrayLength(array)) > 0)) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -150,17 +149,14 @@
 
     {
         jboolean isCopy;
-        if (!NSK_JNI_VERIFY(jni, (elements =
-                NSK_CPP_STUB3(GetByteArrayElements, jni, array,
-                                                            &isCopy)) != NULL)) {
+        if (!NSK_JNI_VERIFY(jni, (elements = jni->GetByteArrayElements(array, &isCopy)) != NULL)) {
             nsk_jvmti_setFailStatus();
         return NSK_FALSE;
         }
     }
     NSK_DISPLAY1("  ... got elements list: 0x%p\n", (void*)elements);
 
-    if (!NSK_JVMTI_VERIFY(
-            NSK_CPP_STUB3(Allocate, jvmti, *size, bytes))) {
+    if (!NSK_JVMTI_VERIFY(jvmti->Allocate(*size, bytes))) {
         nsk_jvmti_setFailStatus();
         return NSK_FALSE;
     }
@@ -172,7 +168,7 @@
     NSK_DISPLAY1("  ... copied bytecode: %d bytes\n", (int)*size);
 
     NSK_DISPLAY1("Release elements list: 0x%p\n", (void*)elements);
-    NSK_TRACE(NSK_CPP_STUB4(ReleaseByteArrayElements, jni, array, elements, JNI_ABORT));
+    NSK_TRACE(jni->ReleaseByteArrayElements(array, elements, JNI_ABORT));
     NSK_DISPLAY0("  ... released\n");
 
     return NSK_TRUE;
@@ -187,23 +183,21 @@
 
     NSK_DISPLAY1("Find static field: %s\n", fieldName);
     if (!NSK_JNI_VERIFY(jni, (fieldID =
-            NSK_CPP_STUB4(GetStaticFieldID, jni, cls, fieldName, fieldSig)) != NULL)) {
+            jni->GetStaticFieldID(cls, fieldName, fieldSig)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NULL;
     }
     NSK_DISPLAY1("  ... got fieldID: 0x%p\n", (void*)fieldID);
 
     NSK_DISPLAY1("Get object from static field: %s\n", fieldName);
-    if (!NSK_JNI_VERIFY(jni, (obj =
-            NSK_CPP_STUB3(GetStaticObjectField, jni, cls, fieldID)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (obj = jni->GetStaticObjectField(cls, fieldID)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NULL;
     }
     NSK_DISPLAY1("  ... got object: 0x%p\n", (void*)obj);
 
     NSK_DISPLAY1("Make global reference to object: 0x%p\n", obj);
-    if (!NSK_JNI_VERIFY(jni, (obj =
-            NSK_CPP_STUB2(NewGlobalRef, jni, obj)) != NULL)) {
+    if (!NSK_JNI_VERIFY(jni, (obj = jni->NewGlobalRef(obj)) != NULL)) {
         nsk_jvmti_setFailStatus();
         return NULL;
     }
@@ -229,7 +223,7 @@
             NSK_DISPLAY0(">>> Obtain debuggee class\n");
             NSK_DISPLAY1("Find debugee class: %s\n", DEBUGEE_CLASS_NAME);
             if (!NSK_JNI_VERIFY(jni, (debugeeClass =
-                    NSK_CPP_STUB2(FindClass, jni, DEBUGEE_CLASS_NAME)) != NULL)) {
+                    jni->FindClass(DEBUGEE_CLASS_NAME)) != NULL)) {
                 nsk_jvmti_setFailStatus();
                 return;
             }
@@ -286,11 +280,10 @@
         NSK_DISPLAY0(">>> Clean used data\n");
         {
             NSK_DISPLAY1("Delete global reference to classloader object: 0x%p\n", (void*)classLoader);
-            NSK_CPP_STUB2(DeleteGlobalRef, jni, classLoader);
+            jni->DeleteGlobalRef(classLoader);
 
             NSK_DISPLAY1("Deallocate classfile bytes array: 0x%p\n", (void*)origClassBytes);
-            if (!NSK_JVMTI_VERIFY(
-                        NSK_CPP_STUB2(Deallocate, jvmti, origClassBytes))) {
+            if (!NSK_JVMTI_VERIFY(jvmti->Deallocate(origClassBytes))) {
                 nsk_jvmti_setFailStatus();
             }
         }
@@ -331,7 +324,7 @@
             NSK_COMPLAIN1("Unexpected NULL classloader in CLASS_FILE_LOAD_HOOK: 0x%p\n",
                                                     (void*)loader);
             nsk_jvmti_setFailStatus();
-        } else if (!NSK_CPP_STUB3(IsSameObject, jni, loader, classLoader)) {
+        } else if (!jni->IsSameObject(loader, classLoader)) {
             NSK_COMPLAIN2("Unexpected classloader in CLASS_FILE_LOAD_HOOK for tested class:\n"
                           "#   got classloder:   0x%p\n"
                           "#   expected same as: 0x%p\n",
@@ -380,8 +373,7 @@
 
         memset(&caps, 0, sizeof(caps));
         caps.can_generate_all_class_hook_events = 1;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
             return JNI_ERR;
         }
     }
@@ -394,8 +386,7 @@
 
         memset(&callbacks, 0, sizeof(callbacks));
         callbacks.ClassFileLoadHook = callbackClassFileLoadHook;
-        if (!NSK_JVMTI_VERIFY(
-                NSK_CPP_STUB3(SetEventCallbacks, jvmti, &callbacks, size))) {
+        if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, size))) {
             return JNI_ERR;
         }
     }