summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dex2oat/dex2oat.cc5
-rw-r--r--runtime/jit/profile_compilation_info.h6
2 files changed, 7 insertions, 4 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index e2177697bf..d2a8154f22 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -2524,7 +2524,10 @@ class Dex2Oat FINAL {
compiler_options_.get(),
oat_file.get()));
elf_writers_.back()->Start();
- const bool do_oat_writer_layout = DoDexLayoutOptimizations() || DoOatLayoutOptimizations();
+ bool do_oat_writer_layout = DoDexLayoutOptimizations() || DoOatLayoutOptimizations();
+ if (profile_compilation_info_ != nullptr && profile_compilation_info_->IsEmpty()) {
+ do_oat_writer_layout = false;
+ }
oat_writers_.emplace_back(new linker::OatWriter(
IsBootImage(),
timings_,
diff --git a/runtime/jit/profile_compilation_info.h b/runtime/jit/profile_compilation_info.h
index f8334cea4f..79cb46170c 100644
--- a/runtime/jit/profile_compilation_info.h
+++ b/runtime/jit/profile_compilation_info.h
@@ -440,6 +440,9 @@ class ProfileCompilationInfo {
// the method returns false. Otherwise it returns true.
bool UpdateProfileKeys(const std::vector<std::unique_ptr<const DexFile>>& dex_files);
+ // Checks if the profile is empty.
+ bool IsEmpty() const;
+
private:
enum ProfileLoadStatus {
kProfileLoadWouldOverwiteData,
@@ -587,9 +590,6 @@ class ProfileCompilationInfo {
// the key or the checksum mismatches.
const DexFileData* FindDexData(const DexFile* dex_file) const;
- // Checks if the profile is empty.
- bool IsEmpty() const;
-
// Inflate the input buffer (in_buffer) of size in_size. It returns a buffer of
// compressed data for the input buffer of "compressed_data_size" size.
std::unique_ptr<uint8_t[]> DeflateBuffer(const uint8_t* in_buffer,