Image space cleanup for app images

Removed Heap::GetImageSpace, added Heap::GetBootImageSpace.

Generalized some logic in the class linker for image spaces.

Bug: 22858531

Change-Id: Ib3e12bb061a247e232d3dc93b0d6b35eb3a34d25
diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc
index 3f2271e..40a3f14 100644
--- a/compiler/oat_writer.cc
+++ b/compiler/oat_writer.cc
@@ -899,7 +899,7 @@
       // NOTE: We're using linker patches for app->boot references when the image can
       // be relocated and therefore we need to emit .oat_patches. We're not using this
       // for app->app references, so check that the method is an image method.
-      gc::space::ImageSpace* image_space = Runtime::Current()->GetHeap()->GetImageSpace();
+      gc::space::ImageSpace* image_space = Runtime::Current()->GetHeap()->GetBootImageSpace();
       size_t method_offset = reinterpret_cast<const uint8_t*>(method) - image_space->Begin();
       CHECK(image_space->GetImageHeader().GetMethodsSection().Contains(method_offset));
     }