summaryrefslogtreecommitdiffstats
path: root/runtime/image.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2013-08-28 11:29:12 -0700
committerMathieu Chartier <mathieuc@google.com>2013-08-29 15:52:42 -0700
commit31e8925781c2302f1d1a9b39e216ba415bfe0d7e (patch)
tree12a9173c7134bc08712e46f11ee897072b7afb61 /runtime/image.h
parentc6dfdacea2fd9e268f70328805b0366cdd6b7b9e (diff)
downloadart-31e8925781c2302f1d1a9b39e216ba415bfe0d7e.zip
art-31e8925781c2302f1d1a9b39e216ba415bfe0d7e.tar.gz
art-31e8925781c2302f1d1a9b39e216ba415bfe0d7e.tar.bz2
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
Diffstat (limited to 'runtime/image.h')
-rw-r--r--runtime/image.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/runtime/image.h b/runtime/image.h
index 35e4c5c..5119e3a 100644
--- a/runtime/image.h
+++ b/runtime/image.h
@@ -21,6 +21,7 @@
#include "globals.h"
#include "mirror/object.h"
+#include "utils.h"
namespace art {
@@ -30,6 +31,9 @@ class PACKED(4) ImageHeader {
ImageHeader() {}
ImageHeader(uint32_t image_begin,
+ uint32_t image_size_,
+ uint32_t image_bitmap_offset,
+ uint32_t image_bitmap_size,
uint32_t image_roots,
uint32_t oat_checksum,
uint32_t oat_file_begin,
@@ -56,6 +60,18 @@ class PACKED(4) ImageHeader {
return reinterpret_cast<byte*>(image_begin_);
}
+ size_t GetImageSize() const {
+ return static_cast<uint32_t>(image_size_);
+ }
+
+ size_t GetImageBitmapOffset() const {
+ return image_bitmap_offset_;
+ }
+
+ size_t GetImageBitmapSize() const {
+ return image_bitmap_size_;
+ }
+
uint32_t GetOatChecksum() const {
return oat_checksum_;
}
@@ -80,6 +96,10 @@ class PACKED(4) ImageHeader {
return reinterpret_cast<byte*>(oat_file_end_);
}
+ size_t GetBitmapOffset() const {
+ return RoundUp(image_size_, kPageSize);
+ }
+
enum ImageRoot {
kResolutionMethod,
kCalleeSaveMethod,
@@ -106,6 +126,15 @@ class PACKED(4) ImageHeader {
// Required base address for mapping the image.
uint32_t image_begin_;
+ // Image size, not page aligned.
+ uint32_t image_size_;
+
+ // Image bitmap offset in the file.
+ uint32_t image_bitmap_offset_;
+
+ // Size of the image bitmap.
+ uint32_t image_bitmap_size_;
+
// Checksum of the oat file we link to for load time sanity check.
uint32_t oat_checksum_;