Lines Matching refs:env

176 static jclass CacheClass(JNIEnv* env, const char* jni_class_name) {  in CacheClass()  argument
177 ScopedLocalRef<jclass> c(env, env->FindClass(jni_class_name)); in CacheClass()
181 return reinterpret_cast<jclass>(env->NewGlobalRef(c.get())); in CacheClass()
184 static jfieldID CacheField(JNIEnv* env, jclass c, bool is_static, in CacheField() argument
188 ScopedObjectAccess soa(env); in CacheField()
198 ScopedObjectAccess soa(env); in CacheField()
210 static jmethodID CacheMethod(JNIEnv* env, jclass c, bool is_static, in CacheMethod() argument
214 ScopedObjectAccess soa(env); in CacheMethod()
224 ScopedObjectAccess soa(env); in CacheMethod()
236 static jmethodID CacheMethod(JNIEnv* env, const char* klass, bool is_static, in CacheMethod() argument
238 ScopedLocalRef<jclass> java_class(env, env->FindClass(klass)); in CacheMethod()
239 return CacheMethod(env, java_class.get(), is_static, name, signature); in CacheMethod()
242 static jmethodID CachePrimitiveBoxingMethod(JNIEnv* env, char prim_name, const char* boxed_name) { in CachePrimitiveBoxingMethod() argument
243 ScopedLocalRef<jclass> boxed_class(env, env->FindClass(boxed_name)); in CachePrimitiveBoxingMethod()
244 return CacheMethod(env, boxed_class.get(), true, "valueOf", in CachePrimitiveBoxingMethod()
330 void WellKnownClasses::Init(JNIEnv* env) { in Init() argument
335 CacheClass(env, "dalvik/annotation/optimization/CriticalNative"); in Init()
336 …dalvik_annotation_optimization_FastNative = CacheClass(env, "dalvik/annotation/optimization/FastNa… in Init()
337 dalvik_system_BaseDexClassLoader = CacheClass(env, "dalvik/system/BaseDexClassLoader"); in Init()
338 dalvik_system_DelegateLastClassLoader = CacheClass(env, "dalvik/system/DelegateLastClassLoader"); in Init()
339 dalvik_system_DexClassLoader = CacheClass(env, "dalvik/system/DexClassLoader"); in Init()
340 dalvik_system_DexFile = CacheClass(env, "dalvik/system/DexFile"); in Init()
341 dalvik_system_DexPathList = CacheClass(env, "dalvik/system/DexPathList"); in Init()
342 dalvik_system_DexPathList__Element = CacheClass(env, "dalvik/system/DexPathList$Element"); in Init()
343 dalvik_system_EmulatedStackFrame = CacheClass(env, "dalvik/system/EmulatedStackFrame"); in Init()
344 dalvik_system_InMemoryDexClassLoader = CacheClass(env, "dalvik/system/InMemoryDexClassLoader"); in Init()
345 dalvik_system_PathClassLoader = CacheClass(env, "dalvik/system/PathClassLoader"); in Init()
346 dalvik_system_VMRuntime = CacheClass(env, "dalvik/system/VMRuntime"); in Init()
348 java_lang_annotation_Annotation__array = CacheClass(env, "[Ljava/lang/annotation/Annotation;"); in Init()
349 java_lang_BootClassLoader = CacheClass(env, "java/lang/BootClassLoader"); in Init()
350 java_lang_ClassLoader = CacheClass(env, "java/lang/ClassLoader"); in Init()
351 java_lang_ClassNotFoundException = CacheClass(env, "java/lang/ClassNotFoundException"); in Init()
352 java_lang_Daemons = CacheClass(env, "java/lang/Daemons"); in Init()
353 java_lang_Object = CacheClass(env, "java/lang/Object"); in Init()
354 java_lang_OutOfMemoryError = CacheClass(env, "java/lang/OutOfMemoryError"); in Init()
355 java_lang_Error = CacheClass(env, "java/lang/Error"); in Init()
356 java_lang_IllegalAccessError = CacheClass(env, "java/lang/IllegalAccessError"); in Init()
357 java_lang_NoClassDefFoundError = CacheClass(env, "java/lang/NoClassDefFoundError"); in Init()
358 …java_lang_reflect_InvocationTargetException = CacheClass(env, "java/lang/reflect/InvocationTargetE… in Init()
359 java_lang_reflect_Parameter = CacheClass(env, "java/lang/reflect/Parameter"); in Init()
360 java_lang_reflect_Parameter__array = CacheClass(env, "[Ljava/lang/reflect/Parameter;"); in Init()
361 java_lang_reflect_Proxy = CacheClass(env, "java/lang/reflect/Proxy"); in Init()
362 java_lang_RuntimeException = CacheClass(env, "java/lang/RuntimeException"); in Init()
363 java_lang_StackOverflowError = CacheClass(env, "java/lang/StackOverflowError"); in Init()
364 java_lang_String = CacheClass(env, "java/lang/String"); in Init()
365 java_lang_StringFactory = CacheClass(env, "java/lang/StringFactory"); in Init()
366 java_lang_System = CacheClass(env, "java/lang/System"); in Init()
367 java_lang_Thread = CacheClass(env, "java/lang/Thread"); in Init()
368 java_lang_ThreadGroup = CacheClass(env, "java/lang/ThreadGroup"); in Init()
369 java_lang_Throwable = CacheClass(env, "java/lang/Throwable"); in Init()
370 java_lang_Void = CacheClass(env, "java/lang/Void"); in Init()
371 java_nio_Buffer = CacheClass(env, "java/nio/Buffer"); in Init()
372 java_nio_ByteBuffer = CacheClass(env, "java/nio/ByteBuffer"); in Init()
373 java_nio_DirectByteBuffer = CacheClass(env, "java/nio/DirectByteBuffer"); in Init()
374 java_util_Collections = CacheClass(env, "java/util/Collections"); in Init()
375 java_util_function_Consumer = CacheClass(env, "java/util/function/Consumer"); in Init()
376 libcore_reflect_AnnotationFactory = CacheClass(env, "libcore/reflect/AnnotationFactory"); in Init()
377 libcore_reflect_AnnotationMember = CacheClass(env, "libcore/reflect/AnnotationMember"); in Init()
378 libcore_util_EmptyArray = CacheClass(env, "libcore/util/EmptyArray"); in Init()
379 org_apache_harmony_dalvik_ddmc_Chunk = CacheClass(env, "org/apache/harmony/dalvik/ddmc/Chunk"); in Init()
380 …org_apache_harmony_dalvik_ddmc_DdmServer = CacheClass(env, "org/apache/harmony/dalvik/ddmc/DdmServ… in Init()
382 InitFieldsAndMethodsOnly(env); in Init()
385 void WellKnownClasses::InitFieldsAndMethodsOnly(JNIEnv* env) { in InitFieldsAndMethodsOnly() argument
389 …dalvik_system_BaseDexClassLoader_getLdLibraryPath = CacheMethod(env, dalvik_system_BaseDexClassLoa… in InitFieldsAndMethodsOnly()
390 …dalvik_system_VMRuntime_runFinalization = CacheMethod(env, dalvik_system_VMRuntime, true, "runFina… in InitFieldsAndMethodsOnly()
391 …dalvik_system_VMRuntime_hiddenApiUsed = CacheMethod(env, dalvik_system_VMRuntime, true, "hiddenApi… in InitFieldsAndMethodsOnly()
393 …java_lang_ClassNotFoundException_init = CacheMethod(env, java_lang_ClassNotFoundException, false, … in InitFieldsAndMethodsOnly()
394 …java_lang_ClassLoader_loadClass = CacheMethod(env, java_lang_ClassLoader, false, "loadClass", "(Lj… in InitFieldsAndMethodsOnly()
396 java_lang_Daemons_start = CacheMethod(env, java_lang_Daemons, true, "start", "()V"); in InitFieldsAndMethodsOnly()
397 java_lang_Daemons_stop = CacheMethod(env, java_lang_Daemons, true, "stop", "()V"); in InitFieldsAndMethodsOnly()
398 …java_lang_Daemons_waitForDaemonStart = CacheMethod(env, java_lang_Daemons, true, "waitForDaemonSta… in InitFieldsAndMethodsOnly()
399 …java_lang_invoke_MethodHandles_lookup = CacheMethod(env, "java/lang/invoke/MethodHandles", true, "… in InitFieldsAndMethodsOnly()
400 …java_lang_invoke_MethodHandles_Lookup_findConstructor = CacheMethod(env, "java/lang/invoke/MethodH… in InitFieldsAndMethodsOnly()
402 …java_lang_ref_FinalizerReference_add = CacheMethod(env, "java/lang/ref/FinalizerReference", true, … in InitFieldsAndMethodsOnly()
403 …java_lang_ref_ReferenceQueue_add = CacheMethod(env, "java/lang/ref/ReferenceQueue", true, "add", "… in InitFieldsAndMethodsOnly()
405 …java_lang_reflect_InvocationTargetException_init = CacheMethod(env, java_lang_reflect_InvocationTa… in InitFieldsAndMethodsOnly()
406 …java_lang_reflect_Parameter_init = CacheMethod(env, java_lang_reflect_Parameter, false, "<init>", … in InitFieldsAndMethodsOnly()
407 java_lang_String_charAt = CacheMethod(env, java_lang_String, false, "charAt", "(I)C"); in InitFieldsAndMethodsOnly()
408 …java_lang_Thread_dispatchUncaughtException = CacheMethod(env, java_lang_Thread, false, "dispatchUn… in InitFieldsAndMethodsOnly()
409 …java_lang_Thread_init = CacheMethod(env, java_lang_Thread, false, "<init>", "(Ljava/lang/ThreadGro… in InitFieldsAndMethodsOnly()
410 java_lang_Thread_run = CacheMethod(env, java_lang_Thread, false, "run", "()V"); in InitFieldsAndMethodsOnly()
411 …java_lang_ThreadGroup_add = CacheMethod(env, java_lang_ThreadGroup, false, "add", "(Ljava/lang/Thr… in InitFieldsAndMethodsOnly()
412 …java_lang_ThreadGroup_removeThread = CacheMethod(env, java_lang_ThreadGroup, false, "threadTermina… in InitFieldsAndMethodsOnly()
413 java_nio_Buffer_isDirect = CacheMethod(env, java_nio_Buffer, false, "isDirect", "()Z"); in InitFieldsAndMethodsOnly()
414 …java_nio_DirectByteBuffer_init = CacheMethod(env, java_nio_DirectByteBuffer, false, "<init>", "(JI… in InitFieldsAndMethodsOnly()
415 …java_util_function_Consumer_accept = CacheMethod(env, java_util_function_Consumer, false, "accept"… in InitFieldsAndMethodsOnly()
416 …libcore_reflect_AnnotationFactory_createAnnotation = CacheMethod(env, libcore_reflect_AnnotationFa… in InitFieldsAndMethodsOnly()
417 …libcore_reflect_AnnotationMember_init = CacheMethod(env, libcore_reflect_AnnotationMember, false, … in InitFieldsAndMethodsOnly()
418 …org_apache_harmony_dalvik_ddmc_DdmServer_broadcast = CacheMethod(env, org_apache_harmony_dalvik_dd… in InitFieldsAndMethodsOnly()
419 …org_apache_harmony_dalvik_ddmc_DdmServer_dispatch = CacheMethod(env, org_apache_harmony_dalvik_ddm… in InitFieldsAndMethodsOnly()
421 …dalvik_system_BaseDexClassLoader_pathList = CacheField(env, dalvik_system_BaseDexClassLoader, fals… in InitFieldsAndMethodsOnly()
422 …dalvik_system_BaseDexClassLoader_sharedLibraryLoaders = CacheField(env, dalvik_system_BaseDexClass… in InitFieldsAndMethodsOnly()
423 …dalvik_system_DexFile_cookie = CacheField(env, dalvik_system_DexFile, false, "mCookie", "Ljava/lan… in InitFieldsAndMethodsOnly()
424 …dalvik_system_DexFile_fileName = CacheField(env, dalvik_system_DexFile, false, "mFileName", "Ljava… in InitFieldsAndMethodsOnly()
425 …dalvik_system_DexPathList_dexElements = CacheField(env, dalvik_system_DexPathList, false, "dexElem… in InitFieldsAndMethodsOnly()
426 …dalvik_system_DexPathList__Element_dexFile = CacheField(env, dalvik_system_DexPathList__Element, f… in InitFieldsAndMethodsOnly()
427 …dalvik_system_VMRuntime_nonSdkApiUsageConsumer = CacheField(env, dalvik_system_VMRuntime, true, "n… in InitFieldsAndMethodsOnly()
429 ScopedLocalRef<jclass> java_io_FileDescriptor(env, env->FindClass("java/io/FileDescriptor")); in InitFieldsAndMethodsOnly()
430 …java_io_FileDescriptor_descriptor = CacheField(env, java_io_FileDescriptor.get(), false, "descript… in InitFieldsAndMethodsOnly()
432 …java_lang_Thread_parkBlocker = CacheField(env, java_lang_Thread, false, "parkBlocker", "Ljava/lang… in InitFieldsAndMethodsOnly()
433 java_lang_Thread_daemon = CacheField(env, java_lang_Thread, false, "daemon", "Z"); in InitFieldsAndMethodsOnly()
434 …java_lang_Thread_group = CacheField(env, java_lang_Thread, false, "group", "Ljava/lang/ThreadGroup… in InitFieldsAndMethodsOnly()
435 java_lang_Thread_lock = CacheField(env, java_lang_Thread, false, "lock", "Ljava/lang/Object;"); in InitFieldsAndMethodsOnly()
436 java_lang_Thread_name = CacheField(env, java_lang_Thread, false, "name", "Ljava/lang/String;"); in InitFieldsAndMethodsOnly()
437 java_lang_Thread_priority = CacheField(env, java_lang_Thread, false, "priority", "I"); in InitFieldsAndMethodsOnly()
438 java_lang_Thread_nativePeer = CacheField(env, java_lang_Thread, false, "nativePeer", "J"); in InitFieldsAndMethodsOnly()
439 java_lang_Thread_systemDaemon = CacheField(env, java_lang_Thread, false, "systemDaemon", "Z"); in InitFieldsAndMethodsOnly()
440 …java_lang_Thread_unparkedBeforeStart = CacheField(env, java_lang_Thread, false, "unparkedBeforeSta… in InitFieldsAndMethodsOnly()
441 …java_lang_ThreadGroup_groups = CacheField(env, java_lang_ThreadGroup, false, "groups", "[Ljava/lan… in InitFieldsAndMethodsOnly()
442 java_lang_ThreadGroup_ngroups = CacheField(env, java_lang_ThreadGroup, false, "ngroups", "I"); in InitFieldsAndMethodsOnly()
443 …java_lang_ThreadGroup_mainThreadGroup = CacheField(env, java_lang_ThreadGroup, true, "mainThreadGr… in InitFieldsAndMethodsOnly()
444 …java_lang_ThreadGroup_name = CacheField(env, java_lang_ThreadGroup, false, "name", "Ljava/lang/Str… in InitFieldsAndMethodsOnly()
445 …java_lang_ThreadGroup_parent = CacheField(env, java_lang_ThreadGroup, false, "parent", "Ljava/lang… in InitFieldsAndMethodsOnly()
446 …java_lang_ThreadGroup_systemThreadGroup = CacheField(env, java_lang_ThreadGroup, true, "systemThre… in InitFieldsAndMethodsOnly()
447 …java_lang_Throwable_cause = CacheField(env, java_lang_Throwable, false, "cause", "Ljava/lang/Throw… in InitFieldsAndMethodsOnly()
448 …java_lang_Throwable_detailMessage = CacheField(env, java_lang_Throwable, false, "detailMessage", "… in InitFieldsAndMethodsOnly()
449 …java_lang_Throwable_stackTrace = CacheField(env, java_lang_Throwable, false, "stackTrace", "[Ljava… in InitFieldsAndMethodsOnly()
450 …java_lang_Throwable_stackState = CacheField(env, java_lang_Throwable, false, "backtrace", "Ljava/l… in InitFieldsAndMethodsOnly()
451 …java_lang_Throwable_suppressedExceptions = CacheField(env, java_lang_Throwable, false, "suppressed… in InitFieldsAndMethodsOnly()
453 java_nio_Buffer_address = CacheField(env, java_nio_Buffer, false, "address", "J"); in InitFieldsAndMethodsOnly()
454 java_nio_Buffer_capacity = CacheField(env, java_nio_Buffer, false, "capacity", "I"); in InitFieldsAndMethodsOnly()
455 …java_nio_Buffer_elementSizeShift = CacheField(env, java_nio_Buffer, false, "_elementSizeShift", "I… in InitFieldsAndMethodsOnly()
456 java_nio_Buffer_limit = CacheField(env, java_nio_Buffer, false, "limit", "I"); in InitFieldsAndMethodsOnly()
457 java_nio_Buffer_position = CacheField(env, java_nio_Buffer, false, "position", "I"); in InitFieldsAndMethodsOnly()
459 java_nio_ByteBuffer_address = CacheField(env, java_nio_ByteBuffer, false, "address", "J"); in InitFieldsAndMethodsOnly()
460 java_nio_ByteBuffer_hb = CacheField(env, java_nio_ByteBuffer, false, "hb", "[B"); in InitFieldsAndMethodsOnly()
461 java_nio_ByteBuffer_isReadOnly = CacheField(env, java_nio_ByteBuffer, false, "isReadOnly", "Z"); in InitFieldsAndMethodsOnly()
462 java_nio_ByteBuffer_limit = CacheField(env, java_nio_ByteBuffer, false, "limit", "I"); in InitFieldsAndMethodsOnly()
463 java_nio_ByteBuffer_offset = CacheField(env, java_nio_ByteBuffer, false, "offset", "I"); in InitFieldsAndMethodsOnly()
464 …java_util_Collections_EMPTY_LIST = CacheField(env, java_util_Collections, true, "EMPTY_LIST", "Lja… in InitFieldsAndMethodsOnly()
465 …libcore_util_EmptyArray_STACK_TRACE_ELEMENT = CacheField(env, libcore_util_EmptyArray, true, "STAC… in InitFieldsAndMethodsOnly()
466 …org_apache_harmony_dalvik_ddmc_Chunk_data = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk, … in InitFieldsAndMethodsOnly()
467 …org_apache_harmony_dalvik_ddmc_Chunk_length = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk… in InitFieldsAndMethodsOnly()
468 …org_apache_harmony_dalvik_ddmc_Chunk_offset = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk… in InitFieldsAndMethodsOnly()
469 …org_apache_harmony_dalvik_ddmc_Chunk_type = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk, … in InitFieldsAndMethodsOnly()
471 java_lang_Boolean_valueOf = CachePrimitiveBoxingMethod(env, 'Z', "java/lang/Boolean"); in InitFieldsAndMethodsOnly()
472 java_lang_Byte_valueOf = CachePrimitiveBoxingMethod(env, 'B', "java/lang/Byte"); in InitFieldsAndMethodsOnly()
473 java_lang_Character_valueOf = CachePrimitiveBoxingMethod(env, 'C', "java/lang/Character"); in InitFieldsAndMethodsOnly()
474 java_lang_Double_valueOf = CachePrimitiveBoxingMethod(env, 'D', "java/lang/Double"); in InitFieldsAndMethodsOnly()
475 java_lang_Float_valueOf = CachePrimitiveBoxingMethod(env, 'F', "java/lang/Float"); in InitFieldsAndMethodsOnly()
476 java_lang_Integer_valueOf = CachePrimitiveBoxingMethod(env, 'I', "java/lang/Integer"); in InitFieldsAndMethodsOnly()
477 java_lang_Long_valueOf = CachePrimitiveBoxingMethod(env, 'J', "java/lang/Long"); in InitFieldsAndMethodsOnly()
478 java_lang_Short_valueOf = CachePrimitiveBoxingMethod(env, 'S', "java/lang/Short"); in InitFieldsAndMethodsOnly()
481 CacheMethod(env, "java/lang/Double", /*is_static=*/ true, "doubleToRawLongBits", "(D)J"); in InitFieldsAndMethodsOnly()
483 CacheMethod(env, "java/lang/Float", /*is_static=*/ true, "floatToRawIntBits", "(F)I"); in InitFieldsAndMethodsOnly()
486 void WellKnownClasses::LateInit(JNIEnv* env) { in LateInit() argument
490 ScopedLocalRef<jclass> java_lang_Runtime(env, env->FindClass("java/lang/Runtime")); in LateInit()
492 CacheMethod(env, java_lang_Runtime.get(), true, "nativeLoad", in LateInit()
496 CacheMethod(env, java_lang_reflect_Proxy, false, "<init>", in LateInit()
504 CacheMethod(env, java_lang_reflect_Proxy, true, "invoke", in LateInit()
509 void WellKnownClasses::HandleJniIdTypeChange(JNIEnv* env) { in HandleJniIdTypeChange() argument
510 WellKnownClasses::InitFieldsAndMethodsOnly(env); in HandleJniIdTypeChange()
511 WellKnownClasses::LateInit(env); in HandleJniIdTypeChange()