Add extra handling for loading intern tables

Add an extra pass to fix up the app image intern table using a
visitor. This visitor records if there are any image conflicts and
avoids the image fixup phase if there are none.

Added logic to bulk add the image intern table to the boot image.

Will add optimizations later.

Bug: 116059983
Test: test-art-host

Change-Id: I50a6fdaf9c9a049a3d120e88d63fe7da8c9a298c
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index a48f1fe..7787a93 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -86,7 +86,7 @@
 #include "hidden_api.h"
 #include "image-inl.h"
 #include "instrumentation.h"
-#include "intern_table.h"
+#include "intern_table-inl.h"
 #include "interpreter/interpreter.h"
 #include "jit/jit.h"
 #include "jit/jit_code_cache.h"
@@ -1485,7 +1485,9 @@
     }
     {
       ScopedTrace trace2("AddImageStringsToTable");
-      GetInternTable()->AddImagesStringsToTable(heap_->GetBootImageSpaces());
+      for (gc::space::ImageSpace* image_space : heap_->GetBootImageSpaces()) {
+        GetInternTable()->AddImageStringsToTable(image_space, VoidFunctor());
+      }
     }
     if (IsJavaDebuggable()) {
       // Now that we have loaded the boot image, deoptimize its methods if we are running