summaryrefslogtreecommitdiff
path: root/compiler/dex/quick_compiler_callbacks.cc
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2018-01-22 23:02:45 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-01-22 23:02:45 +0000
commitb3c0b5229d2e224e7c895660ed9ba258e4d7a51c (patch)
tree9a43d80a1ee0fc6deb1363fc164f20fea4b7ff25 /compiler/dex/quick_compiler_callbacks.cc
parent7b4c09a39fd1b43995aa6d68958113463bc5b82b (diff)
parente993458e8192b24621cb88a6ebcdbfd66f01da45 (diff)
Merge "ART: Allow oatstatus verification for app dependencies"
Diffstat (limited to 'compiler/dex/quick_compiler_callbacks.cc')
-rw-r--r--compiler/dex/quick_compiler_callbacks.cc15
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