dalvik_system_DexFile.cc revision 0795f23920ee9aabf28e45c63cd592dcccf00216
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "dalvik_system_DexFile.h"
18
19#include <sstream>
20
21#include "base/logging.h"
22#include "base/stl_util.h"
23#include "base/stringprintf.h"
24#include "class_linker.h"
25#include "common_throws.h"
26#include "compiler_filter.h"
27#include "dex_file-inl.h"
28#include "jni_internal.h"
29#include "mirror/class_loader.h"
30#include "mirror/object-inl.h"
31#include "mirror/string.h"
32#include "oat_file.h"
33#include "oat_file_assistant.h"
34#include "oat_file_manager.h"
35#include "os.h"
36#include "runtime.h"
37#include "scoped_thread_state_change-inl.h"
38#include "ScopedLocalRef.h"
39#include "ScopedUtfChars.h"
40#include "utils.h"
41#include "well_known_classes.h"
42#include "zip_archive.h"
43
44namespace art {
45
46static bool ConvertJavaArrayToDexFiles(
47    JNIEnv* env,
48    jobject arrayObject,
49    /*out*/ std::vector<const DexFile*>& dex_files,
50    /*out*/ const OatFile*& oat_file) {
51  jarray array = reinterpret_cast<jarray>(arrayObject);
52
53  jsize array_size = env->GetArrayLength(array);
54  if (env->ExceptionCheck() == JNI_TRUE) {
55    return false;
56  }
57
58  // TODO: Optimize. On 32bit we can use an int array.
59  jboolean is_long_data_copied;
60  jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array),
61                                               &is_long_data_copied);
62  if (env->ExceptionCheck() == JNI_TRUE) {
63    return false;
64  }
65
66  oat_file = reinterpret_cast<const OatFile*>(static_cast<uintptr_t>(long_data[kOatFileIndex]));
67  dex_files.reserve(array_size - 1);
68  for (jsize i = kDexFileIndexStart; i < array_size; ++i) {
69    dex_files.push_back(reinterpret_cast<const DexFile*>(static_cast<uintptr_t>(long_data[i])));
70  }
71
72  env->ReleaseLongArrayElements(reinterpret_cast<jlongArray>(array), long_data, JNI_ABORT);
73  return env->ExceptionCheck() != JNI_TRUE;
74}
75
76static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env,
77                                             const OatFile* oat_file,
78                                             std::vector<std::unique_ptr<const DexFile>>& vec) {
79  // Add one for the oat file.
80  jlongArray long_array = env->NewLongArray(static_cast<jsize>(kDexFileIndexStart + vec.size()));
81  if (env->ExceptionCheck() == JNI_TRUE) {
82    return nullptr;
83  }
84
85  jboolean is_long_data_copied;
86  jlong* long_data = env->GetLongArrayElements(long_array, &is_long_data_copied);
87  if (env->ExceptionCheck() == JNI_TRUE) {
88    return nullptr;
89  }
90
91  long_data[kOatFileIndex] = reinterpret_cast<uintptr_t>(oat_file);
92  for (size_t i = 0; i < vec.size(); ++i) {
93    long_data[kDexFileIndexStart + i] = reinterpret_cast<uintptr_t>(vec[i].get());
94  }
95
96  env->ReleaseLongArrayElements(long_array, long_data, 0);
97  if (env->ExceptionCheck() == JNI_TRUE) {
98    return nullptr;
99  }
100
101  // Now release all the unique_ptrs.
102  for (auto& dex_file : vec) {
103    dex_file.release();
104  }
105
106  return long_array;
107}
108
109// A smart pointer that provides read-only access to a Java string's UTF chars.
110// Unlike libcore's NullableScopedUtfChars, this will *not* throw NullPointerException if
111// passed a null jstring. The correct idiom is:
112//
113//   NullableScopedUtfChars name(env, javaName);
114//   if (env->ExceptionCheck()) {
115//       return null;
116//   }
117//   // ... use name.c_str()
118//
119// TODO: rewrite to get rid of this, or change ScopedUtfChars to offer this option.
120class NullableScopedUtfChars {
121 public:
122  NullableScopedUtfChars(JNIEnv* env, jstring s) : mEnv(env), mString(s) {
123    mUtfChars = (s != nullptr) ? env->GetStringUTFChars(s, nullptr) : nullptr;
124  }
125
126  ~NullableScopedUtfChars() {
127    if (mUtfChars) {
128      mEnv->ReleaseStringUTFChars(mString, mUtfChars);
129    }
130  }
131
132  const char* c_str() const {
133    return mUtfChars;
134  }
135
136  size_t size() const {
137    return strlen(mUtfChars);
138  }
139
140  // Element access.
141  const char& operator[](size_t n) const {
142    return mUtfChars[n];
143  }
144
145 private:
146  JNIEnv* mEnv;
147  jstring mString;
148  const char* mUtfChars;
149
150  // Disallow copy and assignment.
151  NullableScopedUtfChars(const NullableScopedUtfChars&);
152  void operator=(const NullableScopedUtfChars&);
153};
154
155static jobject DexFile_openDexFileNative(JNIEnv* env,
156                                         jclass,
157                                         jstring javaSourceName,
158                                         jstring javaOutputName,
159                                         jint flags ATTRIBUTE_UNUSED,
160                                         jobject class_loader,
161                                         jobjectArray dex_elements) {
162  ScopedUtfChars sourceName(env, javaSourceName);
163  if (sourceName.c_str() == nullptr) {
164    return 0;
165  }
166  NullableScopedUtfChars outputName(env, javaOutputName);
167  if (env->ExceptionCheck()) {
168    return 0;
169  }
170  Runtime* const runtime = Runtime::Current();
171  ClassLinker* linker = runtime->GetClassLinker();
172  std::vector<std::unique_ptr<const DexFile>> dex_files;
173  std::vector<std::string> error_msgs;
174  const OatFile* oat_file = nullptr;
175
176  dex_files = runtime->GetOatFileManager().OpenDexFilesFromOat(sourceName.c_str(),
177                                                               outputName.c_str(),
178                                                               class_loader,
179                                                               dex_elements,
180                                                               /*out*/ &oat_file,
181                                                               /*out*/ &error_msgs);
182
183  if (!dex_files.empty()) {
184    jlongArray array = ConvertDexFilesToJavaArray(env, oat_file, dex_files);
185    if (array == nullptr) {
186      ScopedObjectAccess soa(env);
187      for (auto& dex_file : dex_files) {
188        if (linker->FindDexCache(soa.Self(), *dex_file, true) != nullptr) {
189          dex_file.release();
190        }
191      }
192    }
193    return array;
194  } else {
195    ScopedObjectAccess soa(env);
196    CHECK(!error_msgs.empty());
197    // The most important message is at the end. So set up nesting by going forward, which will
198    // wrap the existing exception as a cause for the following one.
199    auto it = error_msgs.begin();
200    auto itEnd = error_msgs.end();
201    for ( ; it != itEnd; ++it) {
202      ThrowWrappedIOException("%s", it->c_str());
203    }
204
205    return nullptr;
206  }
207}
208
209static jboolean DexFile_closeDexFile(JNIEnv* env, jclass, jobject cookie) {
210  std::vector<const DexFile*> dex_files;
211  const OatFile* oat_file;
212  if (!ConvertJavaArrayToDexFiles(env, cookie, dex_files, oat_file)) {
213    Thread::Current()->AssertPendingException();
214    return JNI_FALSE;
215  }
216  Runtime* const runtime = Runtime::Current();
217  bool all_deleted = true;
218  {
219    ScopedObjectAccess soa(env);
220    ObjPtr<mirror::Object> dex_files_object = soa.Decode<mirror::Object>(cookie);
221    mirror::LongArray* long_dex_files = dex_files_object->AsLongArray();
222    // Delete dex files associated with this dalvik.system.DexFile since there should not be running
223    // code using it. dex_files is a vector due to multidex.
224    ClassLinker* const class_linker = runtime->GetClassLinker();
225    int32_t i = kDexFileIndexStart;  // Oat file is at index 0.
226    for (const DexFile* dex_file : dex_files) {
227      if (dex_file != nullptr) {
228        // Only delete the dex file if the dex cache is not found to prevent runtime crashes if there
229        // are calls to DexFile.close while the ART DexFile is still in use.
230        if (class_linker->FindDexCache(soa.Self(), *dex_file, true) == nullptr) {
231          // Clear the element in the array so that we can call close again.
232          long_dex_files->Set(i, 0);
233          delete dex_file;
234        } else {
235          all_deleted = false;
236        }
237      }
238      ++i;
239    }
240  }
241
242  // oat_file can be null if we are running without dex2oat.
243  if (all_deleted && oat_file != nullptr) {
244    // If all of the dex files are no longer in use we can unmap the corresponding oat file.
245    VLOG(class_linker) << "Unregistering " << oat_file;
246    runtime->GetOatFileManager().UnRegisterAndDeleteOatFile(oat_file);
247  }
248  return all_deleted ? JNI_TRUE : JNI_FALSE;
249}
250
251static jclass DexFile_defineClassNative(JNIEnv* env,
252                                        jclass,
253                                        jstring javaName,
254                                        jobject javaLoader,
255                                        jobject cookie,
256                                        jobject dexFile) {
257  std::vector<const DexFile*> dex_files;
258  const OatFile* oat_file;
259  if (!ConvertJavaArrayToDexFiles(env, cookie, /*out*/ dex_files, /*out*/ oat_file)) {
260    VLOG(class_linker) << "Failed to find dex_file";
261    DCHECK(env->ExceptionCheck());
262    return nullptr;
263  }
264
265  ScopedUtfChars class_name(env, javaName);
266  if (class_name.c_str() == nullptr) {
267    VLOG(class_linker) << "Failed to find class_name";
268    return nullptr;
269  }
270  const std::string descriptor(DotToDescriptor(class_name.c_str()));
271  const size_t hash(ComputeModifiedUtf8Hash(descriptor.c_str()));
272  for (auto& dex_file : dex_files) {
273    const DexFile::ClassDef* dex_class_def =
274        OatDexFile::FindClassDef(*dex_file, descriptor.c_str(), hash);
275    if (dex_class_def != nullptr) {
276      ScopedObjectAccess soa(env);
277      ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
278      StackHandleScope<1> hs(soa.Self());
279      Handle<mirror::ClassLoader> class_loader(
280          hs.NewHandle(soa.Decode<mirror::ClassLoader>(javaLoader)));
281      class_linker->RegisterDexFile(*dex_file, class_loader.Get());
282      mirror::Class* result = class_linker->DefineClass(soa.Self(),
283                                                        descriptor.c_str(),
284                                                        hash,
285                                                        class_loader,
286                                                        *dex_file,
287                                                        *dex_class_def);
288      // Add the used dex file. This only required for the DexFile.loadClass API since normal
289      // class loaders already keep their dex files live.
290      class_linker->InsertDexFileInToClassLoader(soa.Decode<mirror::Object>(dexFile).Decode(),
291                                                 class_loader.Get());
292      if (result != nullptr) {
293        VLOG(class_linker) << "DexFile_defineClassNative returning " << result
294                           << " for " << class_name.c_str();
295        return soa.AddLocalReference<jclass>(result);
296      }
297    }
298  }
299  VLOG(class_linker) << "Failed to find dex_class_def " << class_name.c_str();
300  return nullptr;
301}
302
303// Needed as a compare functor for sets of const char
304struct CharPointerComparator {
305  bool operator()(const char *str1, const char *str2) const {
306    return strcmp(str1, str2) < 0;
307  }
308};
309
310// Note: this can be an expensive call, as we sort out duplicates in MultiDex files.
311static jobjectArray DexFile_getClassNameList(JNIEnv* env, jclass, jobject cookie) {
312  const OatFile* oat_file = nullptr;
313  std::vector<const DexFile*> dex_files;
314  if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) {
315    DCHECK(env->ExceptionCheck());
316    return nullptr;
317  }
318
319  // Push all class descriptors into a set. Use set instead of unordered_set as we want to
320  // retrieve all in the end.
321  std::set<const char*, CharPointerComparator> descriptors;
322  for (auto& dex_file : dex_files) {
323    for (size_t i = 0; i < dex_file->NumClassDefs(); ++i) {
324      const DexFile::ClassDef& class_def = dex_file->GetClassDef(i);
325      const char* descriptor = dex_file->GetClassDescriptor(class_def);
326      descriptors.insert(descriptor);
327    }
328  }
329
330  // Now create output array and copy the set into it.
331  jobjectArray result = env->NewObjectArray(descriptors.size(),
332                                            WellKnownClasses::java_lang_String,
333                                            nullptr);
334  if (result != nullptr) {
335    auto it = descriptors.begin();
336    auto it_end = descriptors.end();
337    jsize i = 0;
338    for (; it != it_end; it++, ++i) {
339      std::string descriptor(DescriptorToDot(*it));
340      ScopedLocalRef<jstring> jdescriptor(env, env->NewStringUTF(descriptor.c_str()));
341      if (jdescriptor.get() == nullptr) {
342        return nullptr;
343      }
344      env->SetObjectArrayElement(result, i, jdescriptor.get());
345    }
346  }
347  return result;
348}
349
350static jint GetDexOptNeeded(JNIEnv* env,
351                            const char* filename,
352                            const char* instruction_set,
353                            const char* compiler_filter_name,
354                            bool profile_changed) {
355  if ((filename == nullptr) || !OS::FileExists(filename)) {
356    LOG(ERROR) << "DexFile_getDexOptNeeded file '" << filename << "' does not exist";
357    ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException"));
358    const char* message = (filename == nullptr) ? "<empty file name>" : filename;
359    env->ThrowNew(fnfe.get(), message);
360    return -1;
361  }
362
363  const InstructionSet target_instruction_set = GetInstructionSetFromString(instruction_set);
364  if (target_instruction_set == kNone) {
365    ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException"));
366    std::string message(StringPrintf("Instruction set %s is invalid.", instruction_set));
367    env->ThrowNew(iae.get(), message.c_str());
368    return -1;
369  }
370
371  CompilerFilter::Filter filter;
372  if (!CompilerFilter::ParseCompilerFilter(compiler_filter_name, &filter)) {
373    ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException"));
374    std::string message(StringPrintf("Compiler filter %s is invalid.", compiler_filter_name));
375    env->ThrowNew(iae.get(), message.c_str());
376    return -1;
377  }
378
379  // TODO: Verify the dex location is well formed, and throw an IOException if
380  // not?
381
382  OatFileAssistant oat_file_assistant(filename, target_instruction_set, false);
383
384  // Always treat elements of the bootclasspath as up-to-date.
385  if (oat_file_assistant.IsInBootClassPath()) {
386    return OatFileAssistant::kNoDexOptNeeded;
387  }
388  return oat_file_assistant.GetDexOptNeeded(filter, profile_changed);
389}
390
391static jstring DexFile_getDexFileStatus(JNIEnv* env,
392                                        jclass,
393                                        jstring javaFilename,
394                                        jstring javaInstructionSet) {
395  ScopedUtfChars filename(env, javaFilename);
396  if (env->ExceptionCheck()) {
397    return nullptr;
398  }
399
400  ScopedUtfChars instruction_set(env, javaInstructionSet);
401  if (env->ExceptionCheck()) {
402    return nullptr;
403  }
404
405  const InstructionSet target_instruction_set = GetInstructionSetFromString(
406      instruction_set.c_str());
407  if (target_instruction_set == kNone) {
408    ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException"));
409    std::string message(StringPrintf("Instruction set %s is invalid.", instruction_set.c_str()));
410    env->ThrowNew(iae.get(), message.c_str());
411    return nullptr;
412  }
413
414  OatFileAssistant oat_file_assistant(filename.c_str(), target_instruction_set,
415                                      false /* load_executable */);
416
417  std::ostringstream status;
418  bool oat_file_exists = false;
419  bool odex_file_exists = false;
420  if (oat_file_assistant.OatFileExists()) {
421    oat_file_exists = true;
422    status << *oat_file_assistant.OatFileName() << " [compilation_filter=";
423    status << CompilerFilter::NameOfFilter(oat_file_assistant.OatFileCompilerFilter());
424    status << ", status=" << oat_file_assistant.OatFileStatus();
425  }
426
427  if (oat_file_assistant.OdexFileExists()) {
428    odex_file_exists = true;
429    if (oat_file_exists) {
430      status << "] ";
431    }
432    status << *oat_file_assistant.OdexFileName() << " [compilation_filter=";
433    status << CompilerFilter::NameOfFilter(oat_file_assistant.OdexFileCompilerFilter());
434    status << ", status=" << oat_file_assistant.OdexFileStatus();
435  }
436
437  if (!oat_file_exists && !odex_file_exists) {
438    status << "invalid[";
439  }
440
441  status << "]";
442  return env->NewStringUTF(status.str().c_str());
443}
444
445static jint DexFile_getDexOptNeeded(JNIEnv* env,
446                                    jclass,
447                                    jstring javaFilename,
448                                    jstring javaInstructionSet,
449                                    jstring javaTargetCompilerFilter,
450                                    jboolean newProfile) {
451  ScopedUtfChars filename(env, javaFilename);
452  if (env->ExceptionCheck()) {
453    return -1;
454  }
455
456  ScopedUtfChars instruction_set(env, javaInstructionSet);
457  if (env->ExceptionCheck()) {
458    return -1;
459  }
460
461  ScopedUtfChars target_compiler_filter(env, javaTargetCompilerFilter);
462  if (env->ExceptionCheck()) {
463    return -1;
464  }
465
466  return GetDexOptNeeded(env,
467                         filename.c_str(),
468                         instruction_set.c_str(),
469                         target_compiler_filter.c_str(),
470                         newProfile == JNI_TRUE);
471}
472
473// public API
474static jboolean DexFile_isDexOptNeeded(JNIEnv* env, jclass, jstring javaFilename) {
475  ScopedUtfChars filename_utf(env, javaFilename);
476  if (env->ExceptionCheck()) {
477    return JNI_FALSE;
478  }
479
480  const char* filename = filename_utf.c_str();
481  if ((filename == nullptr) || !OS::FileExists(filename)) {
482    LOG(ERROR) << "DexFile_isDexOptNeeded file '" << filename << "' does not exist";
483    ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException"));
484    const char* message = (filename == nullptr) ? "<empty file name>" : filename;
485    env->ThrowNew(fnfe.get(), message);
486    return JNI_FALSE;
487  }
488
489  OatFileAssistant oat_file_assistant(filename, kRuntimeISA, false);
490  return oat_file_assistant.IsUpToDate() ? JNI_FALSE : JNI_TRUE;
491}
492
493static jboolean DexFile_isValidCompilerFilter(JNIEnv* env,
494                                            jclass javeDexFileClass ATTRIBUTE_UNUSED,
495                                            jstring javaCompilerFilter) {
496  ScopedUtfChars compiler_filter(env, javaCompilerFilter);
497  if (env->ExceptionCheck()) {
498    return -1;
499  }
500
501  CompilerFilter::Filter filter;
502  return CompilerFilter::ParseCompilerFilter(compiler_filter.c_str(), &filter)
503      ? JNI_TRUE : JNI_FALSE;
504}
505
506static jboolean DexFile_isProfileGuidedCompilerFilter(JNIEnv* env,
507                                                      jclass javeDexFileClass ATTRIBUTE_UNUSED,
508                                                      jstring javaCompilerFilter) {
509  ScopedUtfChars compiler_filter(env, javaCompilerFilter);
510  if (env->ExceptionCheck()) {
511    return -1;
512  }
513
514  CompilerFilter::Filter filter;
515  if (!CompilerFilter::ParseCompilerFilter(compiler_filter.c_str(), &filter)) {
516    return JNI_FALSE;
517  }
518  return CompilerFilter::DependsOnProfile(filter) ? JNI_TRUE : JNI_FALSE;
519}
520
521static jstring DexFile_getNonProfileGuidedCompilerFilter(JNIEnv* env,
522                                                         jclass javeDexFileClass ATTRIBUTE_UNUSED,
523                                                         jstring javaCompilerFilter) {
524  ScopedUtfChars compiler_filter(env, javaCompilerFilter);
525  if (env->ExceptionCheck()) {
526    return nullptr;
527  }
528
529  CompilerFilter::Filter filter;
530  if (!CompilerFilter::ParseCompilerFilter(compiler_filter.c_str(), &filter)) {
531    return javaCompilerFilter;
532  }
533
534  CompilerFilter::Filter new_filter = CompilerFilter::GetNonProfileDependentFilterFrom(filter);
535
536  // Filter stayed the same, return input.
537  if (filter == new_filter) {
538    return javaCompilerFilter;
539  }
540
541  // Create a new string object and return.
542  std::string new_filter_str = CompilerFilter::NameOfFilter(new_filter);
543  return env->NewStringUTF(new_filter_str.c_str());
544}
545
546static jboolean DexFile_isBackedByOatFile(JNIEnv* env, jclass, jobject cookie) {
547  const OatFile* oat_file = nullptr;
548  std::vector<const DexFile*> dex_files;
549  if (!ConvertJavaArrayToDexFiles(env, cookie, /*out */ dex_files, /* out */ oat_file)) {
550    DCHECK(env->ExceptionCheck());
551    return false;
552  }
553  return oat_file != nullptr;
554}
555
556static jstring DexFile_getDexFileOutputPath(JNIEnv* env,
557                                            jclass,
558                                            jstring javaFilename,
559                                            jstring javaInstructionSet) {
560  ScopedUtfChars filename(env, javaFilename);
561  if (env->ExceptionCheck()) {
562    return nullptr;
563  }
564
565  ScopedUtfChars instruction_set(env, javaInstructionSet);
566  if (env->ExceptionCheck()) {
567    return nullptr;
568  }
569
570  const InstructionSet target_instruction_set = GetInstructionSetFromString(
571      instruction_set.c_str());
572  if (target_instruction_set == kNone) {
573    ScopedLocalRef<jclass> iae(env, env->FindClass("java/lang/IllegalArgumentException"));
574    std::string message(StringPrintf("Instruction set %s is invalid.", instruction_set.c_str()));
575    env->ThrowNew(iae.get(), message.c_str());
576    return nullptr;
577  }
578
579  OatFileAssistant oat_file_assistant(filename.c_str(),
580                                      target_instruction_set,
581                                      false /* load_executable */);
582
583  std::unique_ptr<OatFile> best_oat_file = oat_file_assistant.GetBestOatFile();
584  if (best_oat_file == nullptr) {
585    return nullptr;
586  }
587
588  return env->NewStringUTF(best_oat_file->GetLocation().c_str());
589}
590
591static JNINativeMethod gMethods[] = {
592  NATIVE_METHOD(DexFile, closeDexFile, "(Ljava/lang/Object;)Z"),
593  NATIVE_METHOD(DexFile,
594                defineClassNative,
595                "(Ljava/lang/String;"
596                "Ljava/lang/ClassLoader;"
597                "Ljava/lang/Object;"
598                "Ldalvik/system/DexFile;"
599                ")Ljava/lang/Class;"),
600  NATIVE_METHOD(DexFile, getClassNameList, "(Ljava/lang/Object;)[Ljava/lang/String;"),
601  NATIVE_METHOD(DexFile, isDexOptNeeded, "(Ljava/lang/String;)Z"),
602  NATIVE_METHOD(DexFile, getDexOptNeeded,
603                "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)I"),
604  NATIVE_METHOD(DexFile, openDexFileNative,
605                "(Ljava/lang/String;"
606                "Ljava/lang/String;"
607                "I"
608                "Ljava/lang/ClassLoader;"
609                "[Ldalvik/system/DexPathList$Element;"
610                ")Ljava/lang/Object;"),
611  NATIVE_METHOD(DexFile, isValidCompilerFilter, "(Ljava/lang/String;)Z"),
612  NATIVE_METHOD(DexFile, isProfileGuidedCompilerFilter, "(Ljava/lang/String;)Z"),
613  NATIVE_METHOD(DexFile,
614                getNonProfileGuidedCompilerFilter,
615                "(Ljava/lang/String;)Ljava/lang/String;"),
616  NATIVE_METHOD(DexFile, isBackedByOatFile, "(Ljava/lang/Object;)Z"),
617  NATIVE_METHOD(DexFile, getDexFileStatus,
618                "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
619  NATIVE_METHOD(DexFile, getDexFileOutputPath,
620                "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;")
621};
622
623void register_dalvik_system_DexFile(JNIEnv* env) {
624  REGISTER_NATIVE_METHODS("dalvik/system/DexFile");
625}
626
627}  // namespace art
628