Load app images
Support in-place patching of the app image based on boot image
location and app oat location. Only loads for art run test so far
since we do not automatically generate app images for app installs.
N5 maps launch time (~200 runs):
Before: 930ms
After: 878.18ms
After + image class table: 864.57ms
TODO:
Oatdump support.
Store class loaders as class roots in image.
Bug: 22858531
Change-Id: I9cbc645645e62ea2ed1ad8e139e91af7d88514c1
diff --git a/compiler/image_writer.h b/compiler/image_writer.h
index ad69038..622eb19 100644
--- a/compiler/image_writer.h
+++ b/compiler/image_writer.h
@@ -49,7 +49,7 @@
class ClassTable;
-static constexpr int kInvalidImageFd = -1;
+static constexpr int kInvalidFd = -1;
// Write a Space built during compilation for use during execution.
class ImageWriter FINAL {
@@ -103,11 +103,15 @@
uint8_t* GetOatFileBegin(const char* oat_filename) const;
- // If image_fd is not kInvalidImageFd, then we use that for the file. Otherwise we open
+ // If image_fd is not kInvalidFd, then we use that for the image file. Otherwise we open
// the names in image_filenames.
+ // If oat_fd is not kInvalidFd, then we use that for the oat file. Otherwise we open
+ // the names in oat_filenames.
bool Write(int image_fd,
const std::vector<const char*>& image_filenames,
- const std::vector<const char*>& oat_filenames)
+ int oat_fd,
+ const std::vector<const char*>& oat_filenames,
+ const std::string& oat_location)
REQUIRES(!Locks::mutator_lock_);
uintptr_t GetOatDataBegin(const char* oat_filename) {
@@ -447,6 +451,10 @@
const ImageInfo& GetConstImageInfo(const char* oat_filename) const;
const ImageInfo& GetImageInfo(size_t index) const;
+ // Find an already strong interned string in the other images or in the boot image. Used to
+ // remove duplicates in the multi image and app image case.
+ mirror::String* FindInternedString(mirror::String* string) SHARED_REQUIRES(Locks::mutator_lock_);
+
const CompilerDriver& compiler_driver_;
// Beginning target image address for the first image.