diff options
author | David Srbecky <dsrbecky@google.com> | 2015-05-01 15:00:40 +0100 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2015-05-01 15:00:40 +0100 |
commit | 6d73c9d06bc0fc6b32825ca0a8224010933a026e (patch) | |
tree | 2601d0ae98704dc77e5b025b93dedae92ec2b821 | |
parent | 01ce498499eed47e87fceb8736d26fe49b2a4346 (diff) | |
download | art-6d73c9d06bc0fc6b32825ca0a8224010933a026e.tar.gz art-6d73c9d06bc0fc6b32825ca0a8224010933a026e.tar.bz2 art-6d73c9d06bc0fc6b32825ca0a8224010933a026e.zip |
Do not write CFI and symbols for deduplicate methods.
There is no need to have multiple symbols for a given address
since libunwind still has to pick only one to print.
Likewise, there is no need to duplicate the CFI.
There is fair number of duplicate methods in the boot image,
so this saves over 20% from those debug sections.
Change-Id: Ib4390150257d009a6303b084076750ce56afed60
-rw-r--r-- | compiler/elf_writer_debug.cc | 12 | ||||
-rw-r--r-- | compiler/elf_writer_quick.cc | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/compiler/elf_writer_debug.cc b/compiler/elf_writer_debug.cc index 28e6999472..e8c3b6e432 100644 --- a/compiler/elf_writer_debug.cc +++ b/compiler/elf_writer_debug.cc @@ -170,11 +170,13 @@ void WriteEhFrame(const CompilerDriver* compiler, size_t cie_offset = eh_frame->size(); WriteEhFrameCIE(isa, address_type, eh_frame); for (const OatWriter::DebugInfo& mi : method_infos) { - const SwapVector<uint8_t>* opcodes = mi.compiled_method_->GetCFIInfo(); - if (opcodes != nullptr) { - WriteEhFrameFDE(Is64BitInstructionSet(isa), cie_offset, - mi.low_pc_, mi.high_pc_ - mi.low_pc_, - opcodes, eh_frame, eh_frame_patches); + if (!mi.deduped_) { // Only one FDE per unique address. + const SwapVector<uint8_t>* opcodes = mi.compiled_method_->GetCFIInfo(); + if (opcodes != nullptr) { + WriteEhFrameFDE(Is64BitInstructionSet(isa), cie_offset, + mi.low_pc_, mi.high_pc_ - mi.low_pc_, + opcodes, eh_frame, eh_frame_patches); + } } } diff --git a/compiler/elf_writer_quick.cc b/compiler/elf_writer_quick.cc index 178aa03955..60f4d0764f 100644 --- a/compiler/elf_writer_quick.cc +++ b/compiler/elf_writer_quick.cc @@ -202,6 +202,9 @@ static void WriteDebugSymbols(ElfBuilder<ElfTypes>* builder, OatWriter* oat_writ auto* symtab = builder->GetSymtab(); for (auto it = method_info.begin(); it != method_info.end(); ++it) { + if (it->deduped_) { + continue; // Add symbol only for the first instance. + } std::string name = PrettyMethod(it->dex_method_index_, *it->dex_file_, true); if (deduped_addresses.find(it->low_pc_) != deduped_addresses.end()) { name += " [DEDUPED]"; |