< prev index next > test/hotspot/jtreg/runtime/clinit/libClassInitBarrier.cpp
Print this page
if (test_class_A == nullptr) return JNI_FALSE;
test_class_B = (jclass)env->NewGlobalRef(arg1);
if (test_class_B == nullptr) return JNI_FALSE;
! test_staticM_id = env->GetStaticMethodID(test_class_A, "staticM", "(Ljava/lang/Runnable;)V");
if (test_staticM_id == nullptr) return JNI_FALSE;
! test_staticS_id = env->GetStaticMethodID(test_class_A, "staticS", "(Ljava/lang/Runnable;)V");
if (test_staticS_id == nullptr) return JNI_FALSE;
! test_staticN_id = env->GetStaticMethodID(test_class_A, "staticN", "(Ljava/lang/Runnable;)V");
if (test_staticN_id == nullptr) return JNI_FALSE;
test_A_m_id = env->GetMethodID(test_class_A, "m", "()V");
if (test_A_m_id == nullptr) return JNI_FALSE;
if (test_class_A == nullptr) return JNI_FALSE;
test_class_B = (jclass)env->NewGlobalRef(arg1);
if (test_class_B == nullptr) return JNI_FALSE;
! test_staticM_id = env->GetStaticMethodID(test_class_A, "staticM", "(Ljava/lang/Runnable;LClassInitBarrier$MyValue;)V");
if (test_staticM_id == nullptr) return JNI_FALSE;
! test_staticS_id = env->GetStaticMethodID(test_class_A, "staticS", "(Ljava/lang/Runnable;LClassInitBarrier$MyValue;)V");
if (test_staticS_id == nullptr) return JNI_FALSE;
! test_staticN_id = env->GetStaticMethodID(test_class_A, "staticN", "(Ljava/lang/Runnable;LClassInitBarrier$MyValue;)V");
if (test_staticN_id == nullptr) return JNI_FALSE;
test_A_m_id = env->GetMethodID(test_class_A, "m", "()V");
if (test_A_m_id == nullptr) return JNI_FALSE;
JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_00024A_staticN(JNIEnv* env, jclass cls, jobject action) {
env->CallVoidMethod(action, methodId);
}
! JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_testInvokeStaticJNI(JNIEnv* env, jclass cls, jobject action) {
! env->CallStaticVoidMethod(test_class_A, test_staticM_id, action);
}
! JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_testInvokeStaticSyncJNI(JNIEnv* env, jclass cls, jobject action) {
! env->CallStaticVoidMethod(test_class_A, test_staticS_id, action);
}
! JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_testInvokeStaticNativeJNI(JNIEnv* env, jclass cls, jobject action) {
! env->CallStaticVoidMethod(test_class_A, test_staticN_id, action);
}
JNIEXPORT jint JNICALL Java_ClassInitBarrier_00024Test_testGetStaticJNI(JNIEnv* env, jclass cls, jobject action) {
jint v = env->GetStaticIntField(test_class_A, test_staticF_id); // int v = A.staticF;
env->CallVoidMethod(action, methodId); // action.run();
JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_00024A_staticN(JNIEnv* env, jclass cls, jobject action) {
env->CallVoidMethod(action, methodId);
}
! JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_testInvokeStaticJNI(JNIEnv* env, jclass cls, jobject action, jobject val) {
! env->CallStaticVoidMethod(test_class_A, test_staticM_id, action, val);
}
! JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_testInvokeStaticSyncJNI(JNIEnv* env, jclass cls, jobject action, jobject val) {
! env->CallStaticVoidMethod(test_class_A, test_staticS_id, action, val);
}
! JNIEXPORT void JNICALL Java_ClassInitBarrier_00024Test_testInvokeStaticNativeJNI(JNIEnv* env, jclass cls, jobject action, jobject val) {
! env->CallStaticVoidMethod(test_class_A, test_staticN_id, action, val);
}
JNIEXPORT jint JNICALL Java_ClassInitBarrier_00024Test_testGetStaticJNI(JNIEnv* env, jclass cls, jobject action) {
jint v = env->GetStaticIntField(test_class_A, test_staticF_id); // int v = A.staticF;
env->CallVoidMethod(action, methodId); // action.run();
< prev index next >