Call madvise hints for image dex files
After opening image spaces, perform madvise hints for the
corresponding dex files.
Moved kMadviseDexFileAccesses to oat_file.cc to not have this enabled
yet.
Bug: 63178181
Test: make and flash
(cherry picked from commit 3efecdef520e80cd79f34549c4ba3a77042d0d92)
Change-Id: If91537e098b159d00354551ce6400a806549b2ca
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 0efc004..051c0c2 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1021,6 +1021,9 @@
std::make_move_iterator(dex_files.begin()),
std::make_move_iterator(dex_files.end()));
}
+ for (const std::unique_ptr<const DexFile>& dex_file : boot_dex_files_) {
+ OatDexFile::MadviseDexFile(*dex_file, MadviseState::kMadviseStateAtLoad);
+ }
FinishInit(self);
VLOG(startup) << __FUNCTION__ << " exiting";