dex2oat: Pack likely-dirty objects together when generating the boot image

This introduces a new algorithm into image writer which "bins" objects
by how likely they are to be dirtied at runtime. Objects in the same bin
are placed contiguously in memory (i.e. into the same page). We try to
tune the bin selection based on how clean or how dirty the object will
likely be at runtime.

As-is, this saves about 150KB per-process (private-dirty pages) and 700KB in
zygote (shared-dirty).

There is still about 800KB of objects that are clean but located in
dirty pages, so with more analysis we can tune the bin selection and get
even more memory savings.

(cherry picked from commit 3f735bd4f9d09a0f9b2b01321e4c6917879dcae6)

Bug: 17611661
Change-Id: Ia1455e4c56ffd0a36ae2a723d35b7e06502980f7
diff --git a/compiler/Android.mk b/compiler/Android.mk
index 610f453..3e0378c 100644
--- a/compiler/Android.mk
+++ b/compiler/Android.mk
@@ -178,6 +178,7 @@
   dex/pass_me.h \
   driver/compiler_driver.h \
   driver/compiler_options.h \
+  image_writer.h \
   optimizing/locations.h \
   utils/arm/constants_arm.h