ART: Clean up #includes in jit_code_cache.h .

And fix code that relied on those indirect #includes.

Also remove forward declaration of art::LinkerPatch because
we actually use art::linker::LinkerPatch.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 65574695
Change-Id: I102affed9a3eacbd21b79c370fbc72b5fc762c96
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index e180752..3220513 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -30,6 +30,7 @@
 #include "entrypoints/runtime_asm_entrypoints.h"
 #include "gc/accounting/bitmap-inl.h"
 #include "gc/scoped_gc_critical_section.h"
+#include "handle.h"
 #include "intern_table.h"
 #include "jit/jit.h"
 #include "jit/profiling_info.h"
@@ -38,8 +39,10 @@
 #include "oat_file-inl.h"
 #include "oat_quick_method_header.h"
 #include "object_callbacks.h"
+#include "profile_compilation_info.h"
 #include "scoped_thread_state_change-inl.h"
 #include "stack.h"
+#include "thread-current-inl.h"
 #include "thread_list.h"
 
 namespace art {
@@ -182,6 +185,8 @@
             << PrettySize(initial_code_capacity);
 }
 
+JitCodeCache::~JitCodeCache() {}
+
 bool JitCodeCache::ContainsPc(const void* ptr) const {
   return code_map_->Begin() <= ptr && ptr < code_map_->End();
 }
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index 9790e3a..46a4085 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -24,24 +24,33 @@
 #include "base/histogram-inl.h"
 #include "base/macros.h"
 #include "base/mutex.h"
-#include "gc/accounting/bitmap.h"
 #include "gc_root.h"
-#include "jni.h"
 #include "method_reference.h"
-#include "oat_file.h"
-#include "profile_compilation_info.h"
 #include "safe_map.h"
-#include "thread_pool.h"
 
 namespace art {
 
 class ArtMethod;
+template<class T> class Handle;
 class LinearAlloc;
 class InlineCache;
 class IsMarkedVisitor;
 class OatQuickMethodHeader;
+struct ProfileMethodInfo;
 class ProfilingInfo;
 
+namespace gc {
+namespace accounting {
+template<size_t kAlignment> class MemoryRangeBitmap;
+}  // namespace accounting
+}  // namespace gc
+
+namespace mirror {
+class Class;
+class Object;
+template<class T> class ObjectArray;
+}  // namespace mirror
+
 namespace jit {
 
 class JitInstrumentationCache;
@@ -66,6 +75,7 @@
                               size_t max_capacity,
                               bool generate_debug_info,
                               std::string* error_msg);
+  ~JitCodeCache();
 
   // Number of bytes allocated in the code cache.
   size_t CodeCacheSize() REQUIRES(!lock_);
@@ -210,11 +220,6 @@
 
   uint64_t GetLastUpdateTimeNs() const;
 
-  size_t GetCurrentCapacity() REQUIRES(!lock_) {
-    MutexLock lock(Thread::Current(), lock_);
-    return current_capacity_;
-  }
-
   size_t GetMemorySizeOfCodePointer(const void* ptr) REQUIRES(!lock_);
 
   void InvalidateCompiledCodeFor(ArtMethod* method, const OatQuickMethodHeader* code)
diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc
index ee35d9c..3071348 100644
--- a/runtime/oat_file_manager.cc
+++ b/runtime/oat_file_manager.cc
@@ -144,6 +144,9 @@
   return nullptr;
 }
 
+OatFileManager::OatFileManager()
+    : have_non_pic_oat_file_(false), only_use_system_oat_files_(false) {}
+
 OatFileManager::~OatFileManager() {
   // Explicitly clear oat_files_ since the OatFile destructor calls back into OatFileManager for
   // UnRegisterOatFileLocation.
diff --git a/runtime/oat_file_manager.h b/runtime/oat_file_manager.h
index 1205773..dd6b7ba 100644
--- a/runtime/oat_file_manager.h
+++ b/runtime/oat_file_manager.h
@@ -45,7 +45,7 @@
 // pointers returned from functions are always valid.
 class OatFileManager {
  public:
-  OatFileManager() : have_non_pic_oat_file_(false), only_use_system_oat_files_(false) {}
+  OatFileManager();
   ~OatFileManager();
 
   // Add an oat file to the internal accounting, std::aborts if there already exists an oat file