diff options
Diffstat (limited to 'compiler/dex/quick_compiler_callbacks.cc')
-rw-r--r-- | compiler/dex/quick_compiler_callbacks.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/dex/quick_compiler_callbacks.cc b/compiler/dex/quick_compiler_callbacks.cc index 540bd0ce45..baf97a852e 100644 --- a/compiler/dex/quick_compiler_callbacks.cc +++ b/compiler/dex/quick_compiler_callbacks.cc @@ -17,6 +17,10 @@ #include "quick_compiler_callbacks.h" #include "driver/compiler_driver.h" +#include "mirror/class-inl.h" +#include "mirror/object.h" +#include "obj_ptr-inl.h" +#include "thread-current-inl.h" #include "verification_results.h" #include "verifier/method_verifier-inl.h" @@ -54,4 +58,15 @@ void QuickCompilerCallbacks::UpdateClassState(ClassReference ref, ClassStatus st } } +bool QuickCompilerCallbacks::CanUseOatStatusForVerification(mirror::Class* klass) { + // No dex files: conservatively false. + if (dex_files_ == nullptr) { + return false; + } + + // If the class isn't from one of the dex files, accept oat file data. + const DexFile* dex_file = &klass->GetDexFile(); + return std::find(dex_files_->begin(), dex_files_->end(), dex_file) == dex_files_->end(); +} + } // namespace art |