Make class loader context fail for unknown class loaders

Update OatFileAssistant to fail the class loader check when getting an
unknown (null) class loader. The code is only use in GetDexoptNeeded paths
and does not affect the runtime behaviour.

This will enable dexoptanalyzer to provide the right answer for dex files
whose class loader changes often.

Test: test-art-host
Bug: 147208643
Change-Id: I869109e669e68afe094e7703ed574575b98d7cc6
diff --git a/runtime/oat_file_assistant.h b/runtime/oat_file_assistant.h
index b5812f9..aa4d83b 100644
--- a/runtime/oat_file_assistant.h
+++ b/runtime/oat_file_assistant.h
@@ -144,10 +144,10 @@
   // the oat location. Returns a negative status code if the status refers to
   // the oat file in the odex location.
   int GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
+                      ClassLoaderContext* context,
+                      const std::vector<int>& context_fds,
                       bool profile_changed = false,
-                      bool downgrade = false,
-                      ClassLoaderContext* context = nullptr,
-                      const std::vector<int>& context_fds = std::vector<int>());
+                      bool downgrade = false);
 
   // Returns true if there is up-to-date code for this dex location,
   // irrespective of the compiler filter of the up-to-date code.
@@ -292,10 +292,10 @@
     // downgrade should be true if the purpose of dexopt is to downgrade the
     // compiler filter.
     DexOptNeeded GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
-                                 bool profile_changed,
-                                 bool downgrade,
                                  ClassLoaderContext* context,
-                                 const std::vector<int>& context_fds);
+                                 const std::vector<int>& context_fds,
+                                 bool profile_changed,
+                                 bool downgrade);
 
     // Returns the loaded file.
     // Loads the file if needed. Returns null if the file failed to load.