Put boot class loader classes and strings in dex cache of app images.

The reason for b/28295348 was that an ArtMethod of the boot image was
in the app image dex cache, but the declaring class of that
boot image method was not.

Since objects of boot images don't need fixups, the comparisons for
FixupStrings and FixupResolvedTypes was always false for them.

bug:28295348

Change-Id: Ida6d42c902692914c302b7fe3d003f73710de6e1
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 149601f..3ae4db9 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1670,6 +1670,10 @@
     // resolve the same way, simply flatten the hierarchy in the way the resolution order would be,
     // and check that the dex file names are the same.
     for (mirror::ClassLoader* image_class_loader : image_class_loaders) {
+      if (IsBootClassLoader(soa, image_class_loader)) {
+        // The dex cache can reference types from the boot class loader.
+        continue;
+      }
       std::list<mirror::String*> image_dex_file_names;
       std::string temp_error_msg;
       if (!FlattenPathClassLoader(image_class_loader, &image_dex_file_names, &temp_error_msg)) {