summaryrefslogtreecommitdiffstats
path: root/compiler/debug
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2018-02-21 12:41:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-02-21 12:41:59 +0000
commit64fbbd3b99bcfb8638596095fb0c8ac24fbcffdc (patch)
tree6b672a008d25ba89e1a2108f7a60b0a1d1e265be /compiler/debug
parentae3c5cc582442e3493aa23155f2ee2f6b4613923 (diff)
parentec419db26d96c74e2cb2418db247f9a94ff0d262 (diff)
downloadart-64fbbd3b99bcfb8638596095fb0c8ac24fbcffdc.tar.gz
art-64fbbd3b99bcfb8638596095fb0c8ac24fbcffdc.tar.bz2
art-64fbbd3b99bcfb8638596095fb0c8ac24fbcffdc.zip
Merge "Don't compress the JIT mini-debug-info if we have just 1 method."
Diffstat (limited to 'compiler/debug')
-rw-r--r--compiler/debug/elf_debug_writer.cc27
1 files changed, 19 insertions, 8 deletions
diff --git a/compiler/debug/elf_debug_writer.cc b/compiler/debug/elf_debug_writer.cc
index df5bb37358..59a080fc21 100644
--- a/compiler/debug/elf_debug_writer.cc
+++ b/compiler/debug/elf_debug_writer.cc
@@ -156,14 +156,25 @@ static std::vector<uint8_t> MakeElfFileForJITInternal(
// No program headers since the ELF file is not linked and has no allocated sections.
builder->Start(false /* write_program_headers */);
if (mini_debug_info) {
- std::vector<uint8_t> mdi = MakeMiniDebugInfo(isa,
- features,
- min_address,
- max_address - min_address,
- /* dex_section_address */ 0,
- /* dex_section_size */ 0,
- debug_info);
- builder->WriteSection(".gnu_debugdata", &mdi);
+ if (method_infos.size() > 1) {
+ std::vector<uint8_t> mdi = MakeMiniDebugInfo(isa,
+ features,
+ min_address,
+ max_address - min_address,
+ /* dex_section_address */ 0,
+ /* dex_section_size */ 0,
+ debug_info);
+ builder->WriteSection(".gnu_debugdata", &mdi);
+ } else {
+ // The compression is great help for multiple methods but it is not worth it for a
+ // single method due to the overheads so skip the compression here for performance.
+ builder->GetText()->AllocateVirtualMemory(min_address, max_address - min_address);
+ WriteDebugSymbols(builder.get(), true /* mini-debug-info */, debug_info);
+ WriteCFISection(builder.get(),
+ debug_info.compiled_methods,
+ dwarf::DW_DEBUG_FRAME_FORMAT,
+ false /* write_oat_paches */);
+ }
} else {
builder->GetText()->AllocateVirtualMemory(min_address, max_address - min_address);
WriteDebugInfo(builder.get(),