< prev index next >

src/hotspot/share/prims/jniCheck.cpp

Print this page




1987 JNI_END
1988 
1989 
1990 JNI_ENTRY_CHECKED(jint,
1991   checked_jni_GetVersion(JNIEnv *env))
1992     functionEnter(thr);
1993     jint result = UNCHECKED()->GetVersion(env);
1994     functionExit(thr);
1995     return result;
1996 JNI_END
1997 
1998 JNI_ENTRY_CHECKED(jobject,
1999   checked_jni_GetModule(JNIEnv *env,
2000                         jclass clazz))
2001     functionEnter(thr);
2002     jobject result = UNCHECKED()->GetModule(env,clazz);
2003     functionExit(thr);
2004     return result;
2005 JNI_END
2006 









































2007 /*
2008  * Structure containing all checked jni functions
2009  */
2010 struct JNINativeInterface_  checked_jni_NativeInterface = {
2011     NULL,
2012     NULL,
2013     NULL,
2014 
2015     NULL,
2016 
2017     checked_jni_GetVersion,
2018 
2019     checked_jni_DefineClass,
2020     checked_jni_FindClass,
2021 
2022     checked_jni_FromReflectedMethod,
2023     checked_jni_FromReflectedField,
2024 
2025     checked_jni_ToReflectedMethod,
2026 


2272     checked_jni_ReleasePrimitiveArrayCritical,
2273 
2274     checked_jni_GetStringCritical,
2275     checked_jni_ReleaseStringCritical,
2276 
2277     checked_jni_NewWeakGlobalRef,
2278     checked_jni_DeleteWeakGlobalRef,
2279 
2280     checked_jni_ExceptionCheck,
2281 
2282     checked_jni_NewDirectByteBuffer,
2283     checked_jni_GetDirectBufferAddress,
2284     checked_jni_GetDirectBufferCapacity,
2285 
2286     // New 1.6 Features
2287 
2288     checked_jni_GetObjectRefType,
2289 
2290     // Module Features
2291 
2292     checked_jni_GetModule







2293 };
2294 
2295 
2296 // Returns the function structure
2297 struct JNINativeInterface_* jni_functions_check() {
2298 
2299   unchecked_jni_NativeInterface = jni_functions_nocheck();
2300 
2301   // make sure the last pointer in the checked table is not null, indicating
2302   // an addition to the JNINativeInterface_ structure without initializing
2303   // it in the checked table.
2304   debug_only(int *lastPtr = (int *)((char *)&checked_jni_NativeInterface + \
2305              sizeof(*unchecked_jni_NativeInterface) - sizeof(char *));)
2306   assert(*lastPtr != 0,
2307          "Mismatched JNINativeInterface tables, check for new entries");
2308 
2309   // with -verbose:jni this message will print
2310   log_debug(jni, resolve)("Checked JNI functions are being used to validate JNI usage");
2311 
2312   return &checked_jni_NativeInterface;


1987 JNI_END
1988 
1989 
1990 JNI_ENTRY_CHECKED(jint,
1991   checked_jni_GetVersion(JNIEnv *env))
1992     functionEnter(thr);
1993     jint result = UNCHECKED()->GetVersion(env);
1994     functionExit(thr);
1995     return result;
1996 JNI_END
1997 
1998 JNI_ENTRY_CHECKED(jobject,
1999   checked_jni_GetModule(JNIEnv *env,
2000                         jclass clazz))
2001     functionEnter(thr);
2002     jobject result = UNCHECKED()->GetModule(env,clazz);
2003     functionExit(thr);
2004     return result;
2005 JNI_END
2006 
2007 JNI_ENTRY_CHECKED(void*,
2008     checked_jni_GetFlattenedArrayElements(JNIEnv* env, jarray array, jboolean* isCopy))
2009     functionEnter(thr);
2010     void* result = UNCHECKED()->GetFlattenedArrayElements(env, array, isCopy);
2011     functionExit(thr);
2012     return result;
2013 
2014 JNI_END
2015 
2016 JNI_ENTRY_CHECKED(void,
2017     checked_jni_ReleaseFlattenedArrayElements(JNIEnv* env, jarray array, void* elem, jint mode))
2018     functionEnter(thr);
2019     UNCHECKED()->ReleaseFlattenedArrayElements(env, array, elem, mode);
2020     functionExit(thr);
2021     return;
2022 JNI_END
2023 
2024 JNI_ENTRY_CHECKED(jclass,
2025     checked_jni_GetFlattenedArrayElementClass(JNIEnv* env, jarray array))
2026     functionEnter(thr);
2027     jclass clazz = UNCHECKED()->GetFlattenedArrayElementClass(env, array);
2028     functionExit(thr);
2029     return clazz;
2030 JNI_END
2031 
2032 JNI_ENTRY_CHECKED(jsize,
2033     checked_jni_GetFlattenedArrayElementSize(JNIEnv* env, jarray array))
2034     functionEnter(thr);
2035     jsize size = UNCHECKED()->GetFlattenedArrayElementSize(env, array);
2036     functionExit(thr);
2037     return size;
2038 JNI_END
2039 
2040 JNI_ENTRY_CHECKED(jsize,
2041     checked_jni_GetFieldOffsetInFlattenedLayout(JNIEnv* env, jclass clazz, const char *name, const char *signature, jboolean* isFlattened))
2042     functionEnter(thr);
2043     jsize offset = UNCHECKED()->GetFieldOffsetInFlattenedLayout(env, clazz, name, signature, isFlattened);
2044     functionExit(thr);
2045     return offset;
2046 JNI_END
2047 
2048 /*
2049  * Structure containing all checked jni functions
2050  */
2051 struct JNINativeInterface_  checked_jni_NativeInterface = {
2052     NULL,
2053     NULL,
2054     NULL,
2055 
2056     NULL,
2057 
2058     checked_jni_GetVersion,
2059 
2060     checked_jni_DefineClass,
2061     checked_jni_FindClass,
2062 
2063     checked_jni_FromReflectedMethod,
2064     checked_jni_FromReflectedField,
2065 
2066     checked_jni_ToReflectedMethod,
2067 


2313     checked_jni_ReleasePrimitiveArrayCritical,
2314 
2315     checked_jni_GetStringCritical,
2316     checked_jni_ReleaseStringCritical,
2317 
2318     checked_jni_NewWeakGlobalRef,
2319     checked_jni_DeleteWeakGlobalRef,
2320 
2321     checked_jni_ExceptionCheck,
2322 
2323     checked_jni_NewDirectByteBuffer,
2324     checked_jni_GetDirectBufferAddress,
2325     checked_jni_GetDirectBufferCapacity,
2326 
2327     // New 1.6 Features
2328 
2329     checked_jni_GetObjectRefType,
2330 
2331     // Module Features
2332 
2333     checked_jni_GetModule,
2334 
2335     // Flattened arrays Features
2336     checked_jni_GetFlattenedArrayElements,
2337     checked_jni_ReleaseFlattenedArrayElements,
2338     checked_jni_GetFlattenedArrayElementClass,
2339     checked_jni_GetFlattenedArrayElementSize,
2340     checked_jni_GetFieldOffsetInFlattenedLayout
2341 };
2342 
2343 
2344 // Returns the function structure
2345 struct JNINativeInterface_* jni_functions_check() {
2346 
2347   unchecked_jni_NativeInterface = jni_functions_nocheck();
2348 
2349   // make sure the last pointer in the checked table is not null, indicating
2350   // an addition to the JNINativeInterface_ structure without initializing
2351   // it in the checked table.
2352   debug_only(int *lastPtr = (int *)((char *)&checked_jni_NativeInterface + \
2353              sizeof(*unchecked_jni_NativeInterface) - sizeof(char *));)
2354   assert(*lastPtr != 0,
2355          "Mismatched JNINativeInterface tables, check for new entries");
2356 
2357   // with -verbose:jni this message will print
2358   log_debug(jni, resolve)("Checked JNI functions are being used to validate JNI usage");
2359 
2360   return &checked_jni_NativeInterface;
< prev index next >