Add new --layout-profile compiler-filter for dex2oat.
New compiler filter makes dex2oat call into dexlayout.
Added basic test for --layout-profile filter to make sure dex2oat runs
to completion and file is valid. Contests of file are not checked.
Test: mm test-art-host-gtest-dexlayout_test
Bug: 29921113
Change-Id: I4bd0dea3d3f1284c155d1d9dea80a48062e67770
diff --git a/compiler/oat_writer.h b/compiler/oat_writer.h
index b92ba76..f9671d7 100644
--- a/compiler/oat_writer.h
+++ b/compiler/oat_writer.h
@@ -38,6 +38,7 @@
class CompiledMethod;
class CompilerDriver;
class ImageWriter;
+class ProfileCompilationInfo;
class OutputStream;
class TimingLogger;
class TypeLookupTable;
@@ -110,7 +111,7 @@
kDefault = kCreate
};
- OatWriter(bool compiling_boot_image, TimingLogger* timings);
+ OatWriter(bool compiling_boot_image, TimingLogger* timings, ProfileCompilationInfo* info);
// To produce a valid oat file, the user must first add sources with any combination of
// - AddDexFileSource(),
@@ -258,6 +259,7 @@
bool WriteDexFiles(OutputStream* out, File* file);
bool WriteDexFile(OutputStream* out, File* file, OatDexFile* oat_dex_file);
bool SeekToDexFile(OutputStream* out, File* file, OatDexFile* oat_dex_file);
+ bool LayoutAndWriteDexFile(OutputStream* out, OatDexFile* oat_dex_file);
bool WriteDexFile(OutputStream* out,
File* file,
OatDexFile* oat_dex_file,
@@ -422,6 +424,9 @@
// The locations of absolute patches relative to the start of the executable section.
dchecked_vector<uintptr_t> absolute_patch_locations_;
+ // Profile info used to generate new layout of files.
+ ProfileCompilationInfo* profile_compilation_info_;
+
DISALLOW_COPY_AND_ASSIGN(OatWriter);
};