Only compile dex files if they are not up to date.

Instead of trying to compile them all the time, and relying on file
permissions to keep us from overwriting up-to-date dex files with
different compiler filters.

Bug: 27641809
Bug: 28639246
Bug: 28826195
Change-Id: Ie717089d58517427b6f9a522b48146761c57a1a9
diff --git a/runtime/oat_file_assistant.h b/runtime/oat_file_assistant.h
index f48cdf3..bb7b408 100644
--- a/runtime/oat_file_assistant.h
+++ b/runtime/oat_file_assistant.h
@@ -149,6 +149,10 @@
   // given compiler filter.
   DexOptNeeded GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter);
 
+  // Returns true if there is up-to-date code for this dex location,
+  // irrespective of the compiler filter of the up-to-date code.
+  bool IsUpToDate();
+
   // Return code used when attempting to generate updated code.
   enum ResultOfAttemptToUpdate {
     kUpdateFailed,        // We tried making the code up to date, but