Skip profiling if the dex file is fully compiled
The OatFile does not store the original dex location that was used to
compile the file. So in order to get the oat file for a given code path
we need to iterate over the inner oat dex files and check against them.
Also, we used to pass the unfiltered code_paths set to the saver which
would make the filtering useless. This fixes the parameter passing as
well.
Bug: 27893309
(cherry picked from commit 7506423b2b9ea13fc5fa9711ab0106977876a5a2)
Change-Id: I99388dee40f2d0e70f970b3f5c6a4171a7e97c0e
diff --git a/runtime/oat_file_manager.h b/runtime/oat_file_manager.h
index 574d0e2..f98102e 100644
--- a/runtime/oat_file_manager.h
+++ b/runtime/oat_file_manager.h
@@ -60,6 +60,11 @@
const OatFile* FindOpenedOatFileFromOatLocation(const std::string& oat_location) const
REQUIRES(!Locks::oat_file_manager_lock_);
+ // Find the oat file which contains a dex files with the given dex base location,
+ // returns null if there are none.
+ const OatFile* FindOpenedOatFileFromDexLocation(const std::string& dex_base_location) const
+ REQUIRES(!Locks::oat_file_manager_lock_);
+
// Attempt to reserve a location, returns false if it is already reserved or already in used by
// an oat file.
bool RegisterOatFileLocation(const std::string& oat_location)