Add dirty_image_objects file.

Allows grouping of classes with dirty static fields to be grouped
together in the image to have fewer dirty pages.

Bug: 62554875
Test: mm test-art-host

(cherry picked from commit 37641ae54ab72509276d0fdd3f0fabeea9988c4a)

Change-Id: Ibc30b13edb9554f79df86e98253ae318a5ece342
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index 1ad8541..5afd067 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -814,6 +814,12 @@
             addOption("-Ximage-compiler-option");
             addOption("--compiled-classes=/system/etc/compiled-classes");
         }
+
+        // If there is a dirty-image-objects file, push it.
+        if (hasFile("/system/etc/dirty-image-objects")) {
+            addOption("-Ximage-compiler-option");
+            addOption("--dirty-image-objects=/system/etc/dirty-image-objects");
+        }
     }
 
     property_get("dalvik.vm.image-dex2oat-flags", dex2oatImageFlagsBuf, "");