• Home
  • Raw
  • Download

Lines Matching refs:env

61     JNIEnv* env,  in ConvertJavaArrayToDexFiles()  argument
67 jsize array_size = env->GetArrayLength(array); in ConvertJavaArrayToDexFiles()
68 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
74 jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array), in ConvertJavaArrayToDexFiles()
76 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertJavaArrayToDexFiles()
86 env->ReleaseLongArrayElements(reinterpret_cast<jlongArray>(array), long_data, JNI_ABORT); in ConvertJavaArrayToDexFiles()
87 return env->ExceptionCheck() != JNI_TRUE; in ConvertJavaArrayToDexFiles()
90 static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env, in ConvertDexFilesToJavaArray() argument
94 jlongArray long_array = env->NewLongArray(static_cast<jsize>(kDexFileIndexStart + vec.size())); in ConvertDexFilesToJavaArray()
95 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
100 jlong* long_data = env->GetLongArrayElements(long_array, &is_long_data_copied); in ConvertDexFilesToJavaArray()
101 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
110 env->ReleaseLongArrayElements(long_array, long_data, 0); in ConvertDexFilesToJavaArray()
111 if (env->ExceptionCheck() == JNI_TRUE) { in ConvertDexFilesToJavaArray()
136 NullableScopedUtfChars(JNIEnv* env, jstring s) : mEnv(env), mString(s) { in NullableScopedUtfChars() argument
137 mUtfChars = (s != nullptr) ? env->GetStringUTFChars(s, nullptr) : nullptr; in NullableScopedUtfChars()
170 JNIEnv* env, in CreateCookieFromOatFileManagerResult() argument
176 ScopedObjectAccess soa(env); in CreateCookieFromOatFileManagerResult()
188 jlongArray array = ConvertDexFilesToJavaArray(env, oat_file, dex_files); in CreateCookieFromOatFileManagerResult()
190 ScopedObjectAccess soa(env); in CreateCookieFromOatFileManagerResult()
200 static MemMap AllocateDexMemoryMap(JNIEnv* env, jint start, jint end) { in AllocateDexMemoryMap() argument
202 ScopedObjectAccess soa(env); in AllocateDexMemoryMap()
215 ScopedObjectAccess soa(env); in AllocateDexMemoryMap()
224 ScopedIntArrayAccessor(JNIEnv* env, jintArray arr) : env_(env), array_(arr) { in ScopedIntArrayAccessor()
241 static jobject DexFile_openInMemoryDexFilesNative(JNIEnv* env, in DexFile_openInMemoryDexFilesNative() argument
249 jsize buffers_length = env->GetArrayLength(buffers); in DexFile_openInMemoryDexFilesNative()
250 CHECK_EQ(buffers_length, env->GetArrayLength(arrays)); in DexFile_openInMemoryDexFilesNative()
251 CHECK_EQ(buffers_length, env->GetArrayLength(jstarts)); in DexFile_openInMemoryDexFilesNative()
252 CHECK_EQ(buffers_length, env->GetArrayLength(jends)); in DexFile_openInMemoryDexFilesNative()
254 ScopedIntArrayAccessor starts(env, jstarts); in DexFile_openInMemoryDexFilesNative()
255 ScopedIntArrayAccessor ends(env, jends); in DexFile_openInMemoryDexFilesNative()
261 jobject buffer = env->GetObjectArrayElement(buffers, i); in DexFile_openInMemoryDexFilesNative()
262 jbyteArray array = reinterpret_cast<jbyteArray>(env->GetObjectArrayElement(arrays, i)); in DexFile_openInMemoryDexFilesNative()
266 MemMap dex_data = AllocateDexMemoryMap(env, start, end); in DexFile_openInMemoryDexFilesNative()
274 uint8_t* base_address = reinterpret_cast<uint8_t*>(env->GetDirectBufferAddress(buffer)); in DexFile_openInMemoryDexFilesNative()
276 ScopedObjectAccess soa(env); in DexFile_openInMemoryDexFilesNative()
285 env->GetByteArrayRegion(array, start, end - start, destination); in DexFile_openInMemoryDexFilesNative()
301 return CreateCookieFromOatFileManagerResult(env, dex_files, oat_file, error_msgs); in DexFile_openInMemoryDexFilesNative()
305 static jobject DexFile_openDexFileNative(JNIEnv* env, in DexFile_openDexFileNative() argument
312 ScopedUtfChars sourceName(env, javaSourceName); in DexFile_openDexFileNative()
325 return CreateCookieFromOatFileManagerResult(env, dex_files, oat_file, error_msgs); in DexFile_openDexFileNative()
328 static jstring DexFile_getClassLoaderContext(JNIEnv* env, in DexFile_getClassLoaderContext() argument
341 return env->NewStringUTF(str_context.c_str()); in DexFile_getClassLoaderContext()
344 static void DexFile_verifyInBackgroundNative(JNIEnv* env, in DexFile_verifyInBackgroundNative() argument
355 if (!ConvertJavaArrayToDexFiles(env, cookie, dex_files, oat_file)) { in DexFile_verifyInBackgroundNative()
361 ScopedUtfChars class_loader_context_utf(env, class_loader_context); in DexFile_verifyInBackgroundNative()
362 if (env->ExceptionCheck()) { in DexFile_verifyInBackgroundNative()
374 static jboolean DexFile_closeDexFile(JNIEnv* env, jclass, jobject cookie) { in DexFile_closeDexFile() argument
377 if (!ConvertJavaArrayToDexFiles(env, cookie, dex_files, oat_file)) { in DexFile_closeDexFile()
387 ScopedObjectAccess soa(env); in DexFile_closeDexFile()
420 static jclass DexFile_defineClassNative(JNIEnv* env, in DexFile_defineClassNative() argument
428 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out*/ dex_files, /*out*/ oat_file)) { in DexFile_defineClassNative()
430 DCHECK(env->ExceptionCheck()); in DexFile_defineClassNative()
434 ScopedUtfChars class_name(env, javaName); in DexFile_defineClassNative()
445 ScopedObjectAccess soa(env); in DexFile_defineClassNative()
486 static jobjectArray DexFile_getClassNameList(JNIEnv* env, jclass, jobject cookie) { in DexFile_getClassNameList() argument
489 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) { in DexFile_getClassNameList()
490 DCHECK(env->ExceptionCheck()); in DexFile_getClassNameList()
506 jobjectArray result = env->NewObjectArray(descriptors.size(), in DexFile_getClassNameList()
515 ScopedLocalRef<jstring> jdescriptor(env, env->NewStringUTF(descriptor.c_str())); in DexFile_getClassNameList()
519 env->SetObjectArrayElement(result, i, jdescriptor.get()); in DexFile_getClassNameList()
525 static jint GetDexOptNeeded(JNIEnv* env, in GetDexOptNeeded() argument
534 ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException")); in GetDexOptNeeded()
536 env->ThrowNew(fnfe.get(), message); in GetDexOptNeeded()
542 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in GetDexOptNeeded()
544 env->ThrowNew(iae.get(), message.c_str()); in GetDexOptNeeded()
550 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in GetDexOptNeeded()
552 env->ThrowNew(iae.get(), message.c_str()); in GetDexOptNeeded()
561 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in GetDexOptNeeded()
564 env->ThrowNew(iae.get(), message.c_str()); in GetDexOptNeeded()
587 static jstring DexFile_getDexFileStatus(JNIEnv* env, in DexFile_getDexFileStatus() argument
591 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexFileStatus()
592 if (env->ExceptionCheck()) { in DexFile_getDexFileStatus()
596 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexFileStatus()
597 if (env->ExceptionCheck()) { in DexFile_getDexFileStatus()
604 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in DexFile_getDexFileStatus()
606 env->ThrowNew(iae.get(), message.c_str()); in DexFile_getDexFileStatus()
612 return env->NewStringUTF(oat_file_assistant.GetStatusDump().c_str()); in DexFile_getDexFileStatus()
617 static jobjectArray DexFile_getDexFileOptimizationStatus(JNIEnv* env, in DexFile_getDexFileOptimizationStatus() argument
621 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexFileOptimizationStatus()
622 if (env->ExceptionCheck()) { in DexFile_getDexFileOptimizationStatus()
626 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexFileOptimizationStatus()
627 if (env->ExceptionCheck()) { in DexFile_getDexFileOptimizationStatus()
634 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in DexFile_getDexFileOptimizationStatus()
636 env->ThrowNew(iae.get(), message.c_str()); in DexFile_getDexFileOptimizationStatus()
645 ScopedLocalRef<jstring> j_compilation_filter(env, env->NewStringUTF(compilation_filter.c_str())); in DexFile_getDexFileOptimizationStatus()
649 ScopedLocalRef<jstring> j_compilation_reason(env, env->NewStringUTF(compilation_reason.c_str())); in DexFile_getDexFileOptimizationStatus()
655 jobjectArray result = env->NewObjectArray(2, in DexFile_getDexFileOptimizationStatus()
658 env->SetObjectArrayElement(result, 0, j_compilation_filter.get()); in DexFile_getDexFileOptimizationStatus()
659 env->SetObjectArrayElement(result, 1, j_compilation_reason.get()); in DexFile_getDexFileOptimizationStatus()
664 static jint DexFile_getDexOptNeeded(JNIEnv* env, in DexFile_getDexOptNeeded() argument
672 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexOptNeeded()
673 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
677 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexOptNeeded()
678 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
682 ScopedUtfChars target_compiler_filter(env, javaTargetCompilerFilter); in DexFile_getDexOptNeeded()
683 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
687 NullableScopedUtfChars class_loader_context(env, javaClassLoaderContext); in DexFile_getDexOptNeeded()
688 if (env->ExceptionCheck()) { in DexFile_getDexOptNeeded()
692 return GetDexOptNeeded(env, in DexFile_getDexOptNeeded()
702 static jboolean DexFile_isDexOptNeeded(JNIEnv* env, jclass, jstring javaFilename) { in DexFile_isDexOptNeeded() argument
703 ScopedUtfChars filename_utf(env, javaFilename); in DexFile_isDexOptNeeded()
704 if (env->ExceptionCheck()) { in DexFile_isDexOptNeeded()
711 ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException")); in DexFile_isDexOptNeeded()
713 env->ThrowNew(fnfe.get(), message); in DexFile_isDexOptNeeded()
721 static jboolean DexFile_isValidCompilerFilter(JNIEnv* env, in DexFile_isValidCompilerFilter() argument
724 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_isValidCompilerFilter()
725 if (env->ExceptionCheck()) { in DexFile_isValidCompilerFilter()
734 static jboolean DexFile_isProfileGuidedCompilerFilter(JNIEnv* env, in DexFile_isProfileGuidedCompilerFilter() argument
737 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_isProfileGuidedCompilerFilter()
738 if (env->ExceptionCheck()) { in DexFile_isProfileGuidedCompilerFilter()
749 static jstring DexFile_getNonProfileGuidedCompilerFilter(JNIEnv* env, in DexFile_getNonProfileGuidedCompilerFilter() argument
752 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_getNonProfileGuidedCompilerFilter()
753 if (env->ExceptionCheck()) { in DexFile_getNonProfileGuidedCompilerFilter()
771 return env->NewStringUTF(new_filter_str.c_str()); in DexFile_getNonProfileGuidedCompilerFilter()
774 static jstring DexFile_getSafeModeCompilerFilter(JNIEnv* env, in DexFile_getSafeModeCompilerFilter() argument
777 ScopedUtfChars compiler_filter(env, javaCompilerFilter); in DexFile_getSafeModeCompilerFilter()
778 if (env->ExceptionCheck()) { in DexFile_getSafeModeCompilerFilter()
796 return env->NewStringUTF(new_filter_str.c_str()); in DexFile_getSafeModeCompilerFilter()
799 static jboolean DexFile_isBackedByOatFile(JNIEnv* env, jclass, jobject cookie) { in DexFile_isBackedByOatFile() argument
802 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) { in DexFile_isBackedByOatFile()
803 DCHECK(env->ExceptionCheck()); in DexFile_isBackedByOatFile()
809 static jobjectArray DexFile_getDexFileOutputPaths(JNIEnv* env, in DexFile_getDexFileOutputPaths() argument
813 ScopedUtfChars filename(env, javaFilename); in DexFile_getDexFileOutputPaths()
814 if (env->ExceptionCheck()) { in DexFile_getDexFileOutputPaths()
818 ScopedUtfChars instruction_set(env, javaInstructionSet); in DexFile_getDexFileOutputPaths()
819 if (env->ExceptionCheck()) { in DexFile_getDexFileOutputPaths()
826 ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException")); in DexFile_getDexFileOutputPaths()
828 env->ThrowNew(iae.get(), message.c_str()); in DexFile_getDexFileOutputPaths()
844 ScopedLocalRef<jstring> jvdexFilename(env, env->NewStringUTF(vdex_filename.c_str())); in DexFile_getDexFileOutputPaths()
848 ScopedLocalRef<jstring> joatFilename(env, env->NewStringUTF(oat_filename.c_str())); in DexFile_getDexFileOutputPaths()
854 jobjectArray result = env->NewObjectArray(2, in DexFile_getDexFileOutputPaths()
857 env->SetObjectArrayElement(result, 0, jvdexFilename.get()); in DexFile_getDexFileOutputPaths()
858 env->SetObjectArrayElement(result, 1, joatFilename.get()); in DexFile_getDexFileOutputPaths()
863 static jlong DexFile_getStaticSizeOfDexFile(JNIEnv* env, jclass, jobject cookie) { in DexFile_getStaticSizeOfDexFile() argument
866 if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) { in DexFile_getStaticSizeOfDexFile()
867 DCHECK(env->ExceptionCheck()); in DexFile_getStaticSizeOfDexFile()
880 static void DexFile_setTrusted(JNIEnv* env, jclass, jobject j_cookie) { in DexFile_setTrusted() argument
882 ScopedObjectAccess soa(env); in DexFile_setTrusted()
892 if (!ConvertJavaArrayToDexFiles(env, j_cookie, dex_files, oat_file)) { in DexFile_setTrusted()
959 void register_dalvik_system_DexFile(JNIEnv* env) { in register_dalvik_system_DexFile() argument