• Home
  • Raw
  • Download

Lines Matching refs:env

63     JNIEnv* env,  in ConvertJavaArrayToDexFiles()  argument
69 jsize array_size = env->GetArrayLength(array); in ConvertJavaArrayToDexFiles()
70 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
76 jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array), in ConvertJavaArrayToDexFiles()
78 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
88 env->ReleaseLongArrayElements(reinterpret_cast<jlongArray>(array), long_data, JNI_ABORT); in ConvertJavaArrayToDexFiles()
89 return env->ExceptionCheck() != JNI_TRUE; in ConvertJavaArrayToDexFiles()
92 static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env, in ConvertDexFilesToJavaArray() argument
96 jlongArray long_array = env->NewLongArray(static_cast<jsize>(kDexFileIndexStart + vec.size())); in ConvertDexFilesToJavaArray()
97 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
102 jlong* long_data = env->GetLongArrayElements(long_array, &is_long_data_copied); in ConvertDexFilesToJavaArray()
103 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
112 env->ReleaseLongArrayElements(long_array, long_data, 0); in ConvertDexFilesToJavaArray()
113 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
138 NullableScopedUtfChars(JNIEnv* env, jstring s) : mEnv(env), mString(s) { in NullableScopedUtfChars() argument
139 mUtfChars = (s != nullptr) ? env->GetStringUTFChars(s, nullptr) : nullptr; in NullableScopedUtfChars()
172 JNIEnv* env, in CreateCookieFromOatFileManagerResult() argument
178 ScopedObjectAccess soa(env); in CreateCookieFromOatFileManagerResult()
190 jlongArray array = ConvertDexFilesToJavaArray(env, oat_file, dex_files); in CreateCookieFromOatFileManagerResult()
192 ScopedObjectAccess soa(env); in CreateCookieFromOatFileManagerResult()
202 static MemMap AllocateDexMemoryMap(JNIEnv* env, jint start, jint end) { in AllocateDexMemoryMap() argument
204 ScopedObjectAccess soa(env); in AllocateDexMemoryMap()
217 ScopedObjectAccess soa(env); in AllocateDexMemoryMap()
226 ScopedIntArrayAccessor(JNIEnv* env, jintArray arr) : env_(env), array_(arr) { in ScopedIntArrayAccessor()
243 static jobject DexFile_openInMemoryDexFilesNative(JNIEnv* env, in DexFile_openInMemoryDexFilesNative() argument
251 jsize buffers_length = env->GetArrayLength(buffers); in DexFile_openInMemoryDexFilesNative()
252 CHECK_EQ(buffers_length, env->GetArrayLength(arrays)); in DexFile_openInMemoryDexFilesNative()
253 CHECK_EQ(buffers_length, env->GetArrayLength(jstarts)); in DexFile_openInMemoryDexFilesNative()
254 CHECK_EQ(buffers_length, env->GetArrayLength(jends)); in DexFile_openInMemoryDexFilesNative()
256 ScopedIntArrayAccessor starts(env, jstarts); in DexFile_openInMemoryDexFilesNative()
257 ScopedIntArrayAccessor ends(env, jends); in DexFile_openInMemoryDexFilesNative()
263 jobject buffer = env->GetObjectArrayElement(buffers, i); in DexFile_openInMemoryDexFilesNative()
264 jbyteArray array = reinterpret_cast<jbyteArray>(env->GetObjectArrayElement(arrays, i)); in DexFile_openInMemoryDexFilesNative()
268 MemMap dex_data = AllocateDexMemoryMap(env, start, end); in DexFile_openInMemoryDexFilesNative()
276 uint8_t* base_address = reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(buffer)); in DexFile_openInMemoryDexFilesNative()
278 ScopedObjectAccess soa(env); in DexFile_openInMemoryDexFilesNative()
287 env->GetByteArrayRegion(array, start, end - start, destination); in DexFile_openInMemoryDexFilesNative()
303 return CreateCookieFromOatFileManagerResult(env, dex_files, oat_file, error_msgs); in DexFile_openInMemoryDexFilesNative()
307 static jobject DexFile_openDexFileNative(JNIEnv* env, in DexFile_openDexFileNative() argument
314 ScopedUtfChars sourceName(env, javaSourceName); in DexFile_openDexFileNative()
327 return CreateCookieFromOatFileManagerResult(env, dex_files, oat_file, error_msgs); in DexFile_openDexFileNative()
330 static void DexFile_verifyInBackgroundNative(JNIEnv* env, in DexFile_verifyInBackgroundNative() argument
340 if (!ConvertJavaArrayToDexFiles(env, cookie, dex_files, oat_file)) { in DexFile_verifyInBackgroundNative()
352 static jboolean DexFile_closeDexFile(JNIEnv* env, jclass, jobject cookie) { in DexFile_closeDexFile() argument
355 if (!ConvertJavaArrayToDexFiles(env, cookie, dex_files, oat_file)) { in DexFile_closeDexFile()
365 ScopedObjectAccess soa(env); in DexFile_closeDexFile()
398 static jclass DexFile_defineClassNative(JNIEnv* env, in DexFile_defineClassNative() argument
406 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out*/ dex_files, /*out*/ oat_file)) { in DexFile_defineClassNative()
408 DCHECK(env->ExceptionCheck()); in DexFile_defineClassNative()
412 ScopedUtfChars class_name(env, javaName); in DexFile_defineClassNative()
423 ScopedObjectAccess soa(env); in DexFile_defineClassNative()
464 static jobjectArray DexFile_getClassNameList(JNIEnv* env, jclass, jobject cookie) { in DexFile_getClassNameList() argument
467 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) { in DexFile_getClassNameList()
468 DCHECK(env->ExceptionCheck()); in DexFile_getClassNameList()
484 jobjectArray result = env->NewObjectArray(descriptors.size(), in DexFile_getClassNameList()
493 ScopedLocalRef<jstring> jdescriptor(env, env->NewStringUTF(descriptor.c_str())); in DexFile_getClassNameList()
497 env->SetObjectArrayElement(result, i, jdescriptor.get()); in DexFile_getClassNameList()
503 static jint GetDexOptNeeded(JNIEnv* env, in GetDexOptNeeded() argument
512 ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException")); in GetDexOptNeeded()
514 env->ThrowNew(fnfe.get(), message); in GetDexOptNeeded()
520 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in GetDexOptNeeded()
522 env->ThrowNew(iae.get(), message.c_str()); in GetDexOptNeeded()
528 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in GetDexOptNeeded()
530 env->ThrowNew(iae.get(), message.c_str()); in GetDexOptNeeded()
539 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in GetDexOptNeeded()
542 env->ThrowNew(iae.get(), message.c_str()); in GetDexOptNeeded()
569 static jstring DexFile_getDexFileStatus(JNIEnv* env, in DexFile_getDexFileStatus() argument
573 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexFileStatus()
574 if (env->ExceptionCheck()) { in DexFile_getDexFileStatus()
578 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexFileStatus()
579 if (env->ExceptionCheck()) { in DexFile_getDexFileStatus()
586 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in DexFile_getDexFileStatus()
588 env->ThrowNew(iae.get(), message.c_str()); in DexFile_getDexFileStatus()
596 return env->NewStringUTF(oat_file_assistant.GetStatusDump().c_str()); in DexFile_getDexFileStatus()
601 static jobjectArray DexFile_getDexFileOptimizationStatus(JNIEnv* env, in DexFile_getDexFileOptimizationStatus() argument
605 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexFileOptimizationStatus()
606 if (env->ExceptionCheck()) { in DexFile_getDexFileOptimizationStatus()
610 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexFileOptimizationStatus()
611 if (env->ExceptionCheck()) { in DexFile_getDexFileOptimizationStatus()
618 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in DexFile_getDexFileOptimizationStatus()
620 env->ThrowNew(iae.get(), message.c_str()); in DexFile_getDexFileOptimizationStatus()
629 ScopedLocalRef<jstring> j_compilation_filter(env, env->NewStringUTF(compilation_filter.c_str())); in DexFile_getDexFileOptimizationStatus()
633 ScopedLocalRef<jstring> j_compilation_reason(env, env->NewStringUTF(compilation_reason.c_str())); in DexFile_getDexFileOptimizationStatus()
639 jobjectArray result = env->NewObjectArray(2, in DexFile_getDexFileOptimizationStatus()
642 env->SetObjectArrayElement(result, 0, j_compilation_filter.get()); in DexFile_getDexFileOptimizationStatus()
643 env->SetObjectArrayElement(result, 1, j_compilation_reason.get()); in DexFile_getDexFileOptimizationStatus()
648 static jint DexFile_getDexOptNeeded(JNIEnv* env, in DexFile_getDexOptNeeded() argument
656 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexOptNeeded()
657 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
661 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexOptNeeded()
662 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
666 ScopedUtfChars target_compiler_filter(env, javaTargetCompilerFilter); in DexFile_getDexOptNeeded()
667 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
671 NullableScopedUtfChars class_loader_context(env, javaClassLoaderContext); in DexFile_getDexOptNeeded()
672 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
676 return GetDexOptNeeded(env, in DexFile_getDexOptNeeded()
686 static jboolean DexFile_isDexOptNeeded(JNIEnv* env, jclass, jstring javaFilename) { in DexFile_isDexOptNeeded() argument
687 ScopedUtfChars filename_utf(env, javaFilename); in DexFile_isDexOptNeeded()
688 if (env->ExceptionCheck()) { in DexFile_isDexOptNeeded()
695 ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException")); in DexFile_isDexOptNeeded()
697 env->ThrowNew(fnfe.get(), message); in DexFile_isDexOptNeeded()
708 static jboolean DexFile_isValidCompilerFilter(JNIEnv* env, in DexFile_isValidCompilerFilter() argument
711 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_isValidCompilerFilter()
712 if (env->ExceptionCheck()) { in DexFile_isValidCompilerFilter()
721 static jboolean DexFile_isProfileGuidedCompilerFilter(JNIEnv* env, in DexFile_isProfileGuidedCompilerFilter() argument
724 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_isProfileGuidedCompilerFilter()
725 if (env->ExceptionCheck()) { in DexFile_isProfileGuidedCompilerFilter()
736 static jstring DexFile_getNonProfileGuidedCompilerFilter(JNIEnv* env, in DexFile_getNonProfileGuidedCompilerFilter() argument
739 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_getNonProfileGuidedCompilerFilter()
740 if (env->ExceptionCheck()) { in DexFile_getNonProfileGuidedCompilerFilter()
758 return env->NewStringUTF(new_filter_str.c_str()); in DexFile_getNonProfileGuidedCompilerFilter()
761 static jstring DexFile_getSafeModeCompilerFilter(JNIEnv* env, in DexFile_getSafeModeCompilerFilter() argument
764 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_getSafeModeCompilerFilter()
765 if (env->ExceptionCheck()) { in DexFile_getSafeModeCompilerFilter()
783 return env->NewStringUTF(new_filter_str.c_str()); in DexFile_getSafeModeCompilerFilter()
786 static jboolean DexFile_isBackedByOatFile(JNIEnv* env, jclass, jobject cookie) { in DexFile_isBackedByOatFile() argument
789 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) { in DexFile_isBackedByOatFile()
790 DCHECK(env->ExceptionCheck()); in DexFile_isBackedByOatFile()
796 static jobjectArray DexFile_getDexFileOutputPaths(JNIEnv* env, in DexFile_getDexFileOutputPaths() argument
800 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexFileOutputPaths()
801 if (env->ExceptionCheck()) { in DexFile_getDexFileOutputPaths()
805 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexFileOutputPaths()
806 if (env->ExceptionCheck()) { in DexFile_getDexFileOutputPaths()
813 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in DexFile_getDexFileOutputPaths()
815 env->ThrowNew(iae.get(), message.c_str()); in DexFile_getDexFileOutputPaths()
857 ScopedLocalRef<jstring> jvdexFilename(env, env->NewStringUTF(vdex_filename.c_str())); in DexFile_getDexFileOutputPaths()
861 ScopedLocalRef<jstring> joatFilename(env, env->NewStringUTF(oat_filename.c_str())); in DexFile_getDexFileOutputPaths()
867 jobjectArray result = env->NewObjectArray(2, in DexFile_getDexFileOutputPaths()
870 env->SetObjectArrayElement(result, 0, jvdexFilename.get()); in DexFile_getDexFileOutputPaths()
871 env->SetObjectArrayElement(result, 1, joatFilename.get()); in DexFile_getDexFileOutputPaths()
876 static jlong DexFile_getStaticSizeOfDexFile(JNIEnv* env, jclass, jobject cookie) { in DexFile_getStaticSizeOfDexFile() argument
879 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) { in DexFile_getStaticSizeOfDexFile()
880 DCHECK(env->ExceptionCheck()); in DexFile_getStaticSizeOfDexFile()
893 static void DexFile_setTrusted(JNIEnv* env, jclass, jobject j_cookie) { in DexFile_setTrusted() argument
895 ScopedObjectAccess soa(env); in DexFile_setTrusted()
905 if (!ConvertJavaArrayToDexFiles(env, j_cookie, dex_files, oat_file)) { in DexFile_setTrusted()
967 void register_dalvik_system_DexFile(JNIEnv* env) { in register_dalvik_system_DexFile() argument