Add verify-profile compiler filter
Only verifies and dex2dex compiles classes in the profile. Goal
is to reduce application launch time.
~2x faster than interpret-only for Facebook.
Bug: 27688727
(cherry picked from commit a079e3aa62cceb76c1c1811e6e09bcaf75e20289)
Change-Id: Iad5aa1adee3aa6c2408820e8cbbab2d4412021b8
diff --git a/runtime/jit/offline_profiling_info.cc b/runtime/jit/offline_profiling_info.cc
index ecf34f5..f181ca3 100644
--- a/runtime/jit/offline_profiling_info.cc
+++ b/runtime/jit/offline_profiling_info.cc
@@ -367,6 +367,18 @@
return false;
}
+bool ProfileCompilationInfo::ContainsClass(const DexFile& dex_file, uint16_t class_def_idx) const {
+ auto info_it = info_.find(GetProfileDexFileKey(dex_file.GetLocation()));
+ if (info_it != info_.end()) {
+ if (dex_file.GetLocationChecksum() != info_it->second.checksum) {
+ return false;
+ }
+ const std::set<uint16_t>& classes = info_it->second.class_set;
+ return classes.find(class_def_idx) != classes.end();
+ }
+ return false;
+}
+
uint32_t ProfileCompilationInfo::GetNumberOfMethods() const {
uint32_t total = 0;
for (const auto& it : info_) {