300 301 JNIEXPORT jobject JNICALL 302 JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index); 303 304 JNIEXPORT jvalue JNICALL 305 JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode); 306 307 JNIEXPORT void JNICALL 308 JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val); 309 310 JNIEXPORT void JNICALL 311 JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v, 312 unsigned char vCode); 313 314 JNIEXPORT jobject JNICALL 315 JVM_NewArray(JNIEnv *env, jclass eltClass, jint length); 316 317 JNIEXPORT jobject JNICALL 318 JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim); 319 320 /* 321 * java.lang.Class and java.lang.ClassLoader 322 */ 323 324 #define JVM_CALLER_DEPTH -1 325 326 /* 327 * Returns the immediate caller class of the native method invoking 328 * JVM_GetCallerClass. The Method.invoke and other frames due to 329 * reflection machinery are skipped. 330 * 331 * The depth parameter must be -1 (JVM_DEPTH). The caller is expected 332 * to be marked with sun.reflect.CallerSensitive. The JVM will throw 333 * an error if it is not marked propertly. 334 */ 335 JNIEXPORT jclass JNICALL 336 JVM_GetCallerClass(JNIEnv *env, int depth); 337 338 339 /* 340 * Find primitive classes 341 * utf: class name 342 */ 343 JNIEXPORT jclass JNICALL 344 JVM_FindPrimitiveClass(JNIEnv *env, const char *utf); 345 346 347 /* 348 * Find a class from a boot class loader. Returns NULL if class not found. 349 */ 350 JNIEXPORT jclass JNICALL 351 JVM_FindClassFromBootLoader(JNIEnv *env, const char *name); 352 353 /* 354 * Find a class from a given class loader. Throws ClassNotFoundException. 355 * name: name of class 356 * init: whether initialization is done | 300 301 JNIEXPORT jobject JNICALL 302 JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index); 303 304 JNIEXPORT jvalue JNICALL 305 JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode); 306 307 JNIEXPORT void JNICALL 308 JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val); 309 310 JNIEXPORT void JNICALL 311 JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v, 312 unsigned char vCode); 313 314 JNIEXPORT jobject JNICALL 315 JVM_NewArray(JNIEnv *env, jclass eltClass, jint length); 316 317 JNIEXPORT jobject JNICALL 318 JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim); 319 320 321 /* 322 * Returns the immediate caller class of the native method invoking 323 * JVM_GetCallerClass. The Method.invoke and other frames due to 324 * reflection machinery are skipped. 325 * 326 * The caller is expected to be marked with 327 * jdk.internal.reflect.CallerSensitive. The JVM will throw an 328 * error if it is not marked properly. 329 */ 330 JNIEXPORT jclass JNICALL 331 JVM_GetCallerClass(JNIEnv *env); 332 333 334 /* 335 * Find primitive classes 336 * utf: class name 337 */ 338 JNIEXPORT jclass JNICALL 339 JVM_FindPrimitiveClass(JNIEnv *env, const char *utf); 340 341 342 /* 343 * Find a class from a boot class loader. Returns NULL if class not found. 344 */ 345 JNIEXPORT jclass JNICALL 346 JVM_FindClassFromBootLoader(JNIEnv *env, const char *name); 347 348 /* 349 * Find a class from a given class loader. Throws ClassNotFoundException. 350 * name: name of class 351 * init: whether initialization is done |