Revert^4 "Boot image extension."
This reverts commit f5c5eb30fc71e0c305d678bd3c1c995a5c36d508.
Removed wrong check for no dex files. Dex files can also be
specified with zip-location and file descriptors. Added a
regression test to dex2oat_test.
Fixed the image checksums validation to use the appropriate
part of BCP rather then full BCP. This fixes errorneous
rejection of oat files compiled against partial BCP.
Changed dex2oat_image_test to use ART_BASE_ADDRESS to try
and avoid failures when reserving space for loading the
compiled images.
Test: Additional tests in dex2oat_{,image_}_test
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 119800099
Bug: 143492855
Bug: 144001974
Change-Id: I062cbecd0020f5c24353eb75643ea5905cb6f4fd
diff --git a/runtime/image.cc b/runtime/image.cc
index 256b957..08b81c1 100644
--- a/runtime/image.cc
+++ b/runtime/image.cc
@@ -93,6 +93,13 @@
}
}
+bool ImageHeader::IsAppImage() const {
+ // Unlike boot image and boot image extensions which include address space for
+ // oat files in their reservation size, app images are loaded separately from oat
+ // files and their reservation size is the image size rounded up to full page.
+ return image_reservation_size_ == RoundUp(image_size_, kPageSize);
+}
+
bool ImageHeader::IsValid() const {
if (memcmp(magic_, kImageMagic, sizeof(kImageMagic)) != 0) {
return false;