< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/general_functions/GF06/gf06t001/gf06t001.cpp

Print this page
rev 52050 : [mq]: refactor

*** 73,84 **** */ static int checkEnvStorage(jvmtiEnv* jvmti, const char where[]) { void* storage = NULL; NSK_DISPLAY0("Calling GetEnvironmentLocalStorage():"); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(GetEnvironmentLocalStorage, jvmti, &storage))) { return NSK_FALSE; } NSK_DISPLAY1(" ... got storage: 0x%p\n", (void*)storage); if (storage != NULL) { --- 73,83 ---- */ static int checkEnvStorage(jvmtiEnv* jvmti, const char where[]) { void* storage = NULL; NSK_DISPLAY0("Calling GetEnvironmentLocalStorage():"); ! if (!NSK_JVMTI_VERIFY(jvmti->GetEnvironmentLocalStorage(&storage))) { return NSK_FALSE; } NSK_DISPLAY1(" ... got storage: 0x%p\n", (void*)storage); if (storage != NULL) {
*** 113,125 **** jthread getEnvThread(JNIEnv *env) { jclass thrClass; jmethodID cid; jthread res; ! thrClass = NSK_CPP_STUB2(FindClass, env, "java/lang/Thread"); ! cid = NSK_CPP_STUB4(GetMethodID, env, thrClass, "<init>", "()V"); ! res = NSK_CPP_STUB3(NewObject, env, thrClass, cid); return res; } /* ============================================================================= */ --- 112,124 ---- jthread getEnvThread(JNIEnv *env) { jclass thrClass; jmethodID cid; jthread res; ! thrClass = env->FindClass("java/lang/Thread"); ! cid = env->GetMethodID(thrClass, "<init>", "()V"); ! res = env->NewObject(thrClass, cid); return res; } /* ============================================================================= */
*** 191,202 **** NSK_COMPLAIN0("Wrong result of a valid call to GetEnv!\n"); return JNI_ERR; } NSK_DISPLAY1("Set local storage in JVM_OnLoad() for first JVMTI env: 0x%p\n", (void*)initialStorage); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(SetEnvironmentLocalStorage, jvmti_1, initialStorage))) { return JNI_ERR; } NSK_DISPLAY0(" ... ok\n"); /* Create second environment */ --- 190,200 ---- NSK_COMPLAIN0("Wrong result of a valid call to GetEnv!\n"); return JNI_ERR; } NSK_DISPLAY1("Set local storage in JVM_OnLoad() for first JVMTI env: 0x%p\n", (void*)initialStorage); ! if (!NSK_JVMTI_VERIFY(jvmti_1->SetEnvironmentLocalStorage(initialStorage))) { return JNI_ERR; } NSK_DISPLAY0(" ... ok\n"); /* Create second environment */
*** 210,221 **** memset(&eventCallbacks, 0, sizeof(eventCallbacks)); eventCallbacks.VMInit = callbackVMInit; eventCallbacks.VMDeath = callbackVMDeath; if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(SetEventCallbacks, jvmti_2, ! &eventCallbacks, sizeof(eventCallbacks)))) { return JNI_ERR; } } --- 208,218 ---- memset(&eventCallbacks, 0, sizeof(eventCallbacks)); eventCallbacks.VMInit = callbackVMInit; eventCallbacks.VMDeath = callbackVMDeath; if (!NSK_JVMTI_VERIFY( ! jvmti_2->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) { return JNI_ERR; } }
< prev index next >