summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-10-17 12:27:55 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-10-17 12:27:55 +0000
commit8c0fee9ca38ea1b4ee6a8ab72c5f9c0ba924761f (patch)
tree523144558243e6b810d4f7da192d44628b8e3681 /compiler
parenta3344e8349b6abf2d31d8b973627248706382970 (diff)
parent1a1de67c4923436eb7de7da334c6d77703375dbd (diff)
Merge "Do not write empty class table and intern table to image."
Diffstat (limited to 'compiler')
-rw-r--r--compiler/image_writer.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 13c73dcf42..83c7332151 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -1492,10 +1492,15 @@ void ImageWriter::CalculateNewObjectOffsets() {
// Calculate how big the intern table will be after being serialized.
InternTable* const intern_table = image_info.intern_table_.get();
CHECK_EQ(intern_table->WeakSize(), 0u) << " should have strong interned all the strings";
- image_info.intern_table_bytes_ = intern_table->WriteToMemory(nullptr);
+ if (intern_table->StrongSize() != 0u) {
+ image_info.intern_table_bytes_ = intern_table->WriteToMemory(nullptr);
+ }
// Calculate the size of the class table.
ReaderMutexLock mu(self, *Locks::classlinker_classes_lock_);
- image_info.class_table_bytes_ += image_info.class_table_->WriteToMemory(nullptr);
+ DCHECK_EQ(image_info.class_table_->NumZygoteClasses(), 0u);
+ if (image_info.class_table_->NumNonZygoteClasses() != 0u) {
+ image_info.class_table_bytes_ += image_info.class_table_->WriteToMemory(nullptr);
+ }
}
// Calculate bin slot offsets.