summaryrefslogtreecommitdiffstats
path: root/compiler/image_writer.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2016-01-29 16:27:27 +0000
committerVladimir Marko <vmarko@google.com>2016-01-29 16:30:43 +0000
commitd8904a555ec801af9b99a8912fdb9e615729db7b (patch)
treef1e704987e0caf11689596cc7fdf7aa61f746eda /compiler/image_writer.cc
parentba5ea7003f071f85936ee351aff46f64a56ee096 (diff)
downloadandroid_art-d8904a555ec801af9b99a8912fdb9e615729db7b.tar.gz
android_art-d8904a555ec801af9b99a8912fdb9e615729db7b.tar.bz2
android_art-d8904a555ec801af9b99a8912fdb9e615729db7b.zip
ART: Do not reopen oat file in ImageWriter::UpdateOatFile().
Instead, pass the already opened file from Dex2Oat. Bug: 26831001 Change-Id: I2341259499067f43ce620b590c5482d28f140e9f
Diffstat (limited to 'compiler/image_writer.cc')
-rw-r--r--compiler/image_writer.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 6abc6fae8a..8b7fbf6910 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -2274,12 +2274,11 @@ const ImageWriter::ImageInfo& ImageWriter::GetImageInfo(size_t index) const {
return GetConstImageInfo(oat_filenames_[index]);
}
-void ImageWriter::UpdateOatFile(const char* oat_filename) {
- std::unique_ptr<File> oat_file(OS::OpenFileForReading(oat_filename));
+void ImageWriter::UpdateOatFile(File* oat_file, const char* oat_filename) {
DCHECK(oat_file != nullptr);
size_t oat_loaded_size = 0;
size_t oat_data_offset = 0;
- ElfWriter::GetOatElfInformation(oat_file.get(), &oat_loaded_size, &oat_data_offset);
+ ElfWriter::GetOatElfInformation(oat_file, &oat_loaded_size, &oat_data_offset);
ImageInfo& cur_image_info = GetImageInfo(oat_filename);