Write out image bitmap inside of image file.
We now create the image bitmap when we generate the image. The image
bitmap is written after the image inside of the image file. This
speeds up dex2oat by making walking the image during heap creation
unnecessary. This should also help memory pressure by enabling the
image bitmap to be swappable.
Bug: 10432288
Change-Id: Idebf459ed15edbb41a7d9b9b353934155bce2f19
diff --git a/runtime/gc/space/image_space.h b/runtime/gc/space/image_space.h
index bdda9fa..381a98e 100644
--- a/runtime/gc/space/image_space.h
+++ b/runtime/gc/space/image_space.h
@@ -53,6 +53,9 @@
OatFile& ReleaseOatFile()
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+ void VerifyImageAllocations()
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
const ImageHeader& GetImageHeader() const {
return *reinterpret_cast<ImageHeader*>(Begin());
}
@@ -61,10 +64,6 @@
return GetName();
}
- // Mark the objects defined in this space in the given live bitmap
- void RecordImageAllocations(accounting::SpaceBitmap* live_bitmap) const
- SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
-
accounting::SpaceBitmap* GetLiveBitmap() const {
return live_bitmap_.get();
}
@@ -96,11 +95,11 @@
friend class Space;
- static size_t bitmap_index_;
+ static AtomicInteger bitmap_index_;
UniquePtr<accounting::SpaceBitmap> live_bitmap_;
- ImageSpace(const std::string& name, MemMap* mem_map);
+ ImageSpace(const std::string& name, MemMap* mem_map, accounting::SpaceBitmap* live_bitmap);
// The OatFile associated with the image during early startup to
// reserve space contiguous to the image. It is later released to