< prev index next >

src/hotspot/share/prims/jniCheck.cpp

Print this page

1997       jniCheck::validate_object(thr, obj);
1998     )
1999     jobjectRefType result = UNCHECKED()->GetObjectRefType(env, obj);
2000     functionExit(thr);
2001     return result;
2002 JNI_END
2003 
2004 
2005 JNI_ENTRY_CHECKED(jint,
2006   checked_jni_GetVersion(JNIEnv *env))
2007     functionEnter(thr);
2008     jint result = UNCHECKED()->GetVersion(env);
2009     functionExit(thr);
2010     return result;
2011 JNI_END
2012 
2013 JNI_ENTRY_CHECKED(jobject,
2014   checked_jni_GetModule(JNIEnv *env,
2015                         jclass clazz))
2016     functionEnter(thr);
2017     jobject result = UNCHECKED()->GetModule(env,clazz);









2018     functionExit(thr);
2019     return result;
2020 JNI_END
2021 
2022 /*
2023  * Structure containing all checked jni functions
2024  */
2025 struct JNINativeInterface_  checked_jni_NativeInterface = {
2026     NULL,
2027     NULL,
2028     NULL,
2029 
2030     NULL,
2031 
2032     checked_jni_GetVersion,
2033 
2034     checked_jni_DefineClass,
2035     checked_jni_FindClass,
2036 
2037     checked_jni_FromReflectedMethod,

2287     checked_jni_ReleasePrimitiveArrayCritical,
2288 
2289     checked_jni_GetStringCritical,
2290     checked_jni_ReleaseStringCritical,
2291 
2292     checked_jni_NewWeakGlobalRef,
2293     checked_jni_DeleteWeakGlobalRef,
2294 
2295     checked_jni_ExceptionCheck,
2296 
2297     checked_jni_NewDirectByteBuffer,
2298     checked_jni_GetDirectBufferAddress,
2299     checked_jni_GetDirectBufferCapacity,
2300 
2301     // New 1.6 Features
2302 
2303     checked_jni_GetObjectRefType,
2304 
2305     // Module Features
2306 
2307     checked_jni_GetModule




2308 };
2309 
2310 
2311 // Returns the function structure
2312 struct JNINativeInterface_* jni_functions_check() {
2313 
2314   unchecked_jni_NativeInterface = jni_functions_nocheck();
2315 
2316   // make sure the last pointer in the checked table is not null, indicating
2317   // an addition to the JNINativeInterface_ structure without initializing
2318   // it in the checked table.
2319   debug_only(int *lastPtr = (int *)((char *)&checked_jni_NativeInterface + \
2320              sizeof(*unchecked_jni_NativeInterface) - sizeof(char *));)
2321   assert(*lastPtr != 0,
2322          "Mismatched JNINativeInterface tables, check for new entries");
2323 
2324   // with -verbose:jni this message will print
2325   log_debug(jni, resolve)("Checked JNI functions are being used to validate JNI usage");
2326 
2327   return &checked_jni_NativeInterface;

1997       jniCheck::validate_object(thr, obj);
1998     )
1999     jobjectRefType result = UNCHECKED()->GetObjectRefType(env, obj);
2000     functionExit(thr);
2001     return result;
2002 JNI_END
2003 
2004 
2005 JNI_ENTRY_CHECKED(jint,
2006   checked_jni_GetVersion(JNIEnv *env))
2007     functionEnter(thr);
2008     jint result = UNCHECKED()->GetVersion(env);
2009     functionExit(thr);
2010     return result;
2011 JNI_END
2012 
2013 JNI_ENTRY_CHECKED(jobject,
2014   checked_jni_GetModule(JNIEnv *env,
2015                         jclass clazz))
2016     functionEnter(thr);
2017     jobject result = UNCHECKED()->GetModule(env, clazz);
2018     functionExit(thr);
2019     return result;
2020 JNI_END
2021 
2022 JNI_ENTRY_CHECKED(jboolean,
2023   checked_jni_IsVirtualThread(JNIEnv *env,
2024                               jobject obj))
2025     functionEnter(thr);
2026     jboolean result = UNCHECKED()->IsVirtualThread(env, obj);
2027     functionExit(thr);
2028     return result;
2029 JNI_END
2030 
2031 /*
2032  * Structure containing all checked jni functions
2033  */
2034 struct JNINativeInterface_  checked_jni_NativeInterface = {
2035     NULL,
2036     NULL,
2037     NULL,
2038 
2039     NULL,
2040 
2041     checked_jni_GetVersion,
2042 
2043     checked_jni_DefineClass,
2044     checked_jni_FindClass,
2045 
2046     checked_jni_FromReflectedMethod,

2296     checked_jni_ReleasePrimitiveArrayCritical,
2297 
2298     checked_jni_GetStringCritical,
2299     checked_jni_ReleaseStringCritical,
2300 
2301     checked_jni_NewWeakGlobalRef,
2302     checked_jni_DeleteWeakGlobalRef,
2303 
2304     checked_jni_ExceptionCheck,
2305 
2306     checked_jni_NewDirectByteBuffer,
2307     checked_jni_GetDirectBufferAddress,
2308     checked_jni_GetDirectBufferCapacity,
2309 
2310     // New 1.6 Features
2311 
2312     checked_jni_GetObjectRefType,
2313 
2314     // Module Features
2315 
2316     checked_jni_GetModule,
2317 
2318     // Loom
2319 
2320     checked_jni_IsVirtualThread
2321 };
2322 
2323 
2324 // Returns the function structure
2325 struct JNINativeInterface_* jni_functions_check() {
2326 
2327   unchecked_jni_NativeInterface = jni_functions_nocheck();
2328 
2329   // make sure the last pointer in the checked table is not null, indicating
2330   // an addition to the JNINativeInterface_ structure without initializing
2331   // it in the checked table.
2332   debug_only(int *lastPtr = (int *)((char *)&checked_jni_NativeInterface + \
2333              sizeof(*unchecked_jni_NativeInterface) - sizeof(char *));)
2334   assert(*lastPtr != 0,
2335          "Mismatched JNINativeInterface tables, check for new entries");
2336 
2337   // with -verbose:jni this message will print
2338   log_debug(jni, resolve)("Checked JNI functions are being used to validate JNI usage");
2339 
2340   return &checked_jni_NativeInterface;
< prev index next >