diff options
| author | David Srbecky <dsrbecky@google.com> | 2018-02-16 17:24:16 +0000 |
|---|---|---|
| committer | David Srbecky <dsrbecky@google.com> | 2018-02-21 10:41:06 +0000 |
| commit | ec419db26d96c74e2cb2418db247f9a94ff0d262 (patch) | |
| tree | 44bf29fa39482bd62520a14ad22d4fb68d9c31e6 /compiler/debug | |
| parent | d1652d14fbf477b3091eec3764b9890f2c072055 (diff) | |
| download | art-ec419db26d96c74e2cb2418db247f9a94ff0d262.tar.gz art-ec419db26d96c74e2cb2418db247f9a94ff0d262.tar.bz2 art-ec419db26d96c74e2cb2418db247f9a94ff0d262.zip | |
Don't compress the JIT mini-debug-info if we have just 1 method.
The compression is great help for multiple methods but
it is not worth it for single method due to overheads,
so skip the compression there for a small speed boost.
Test: testrunner.py --host -t 137
Change-Id: Idc37645061c745032474b5115e66b1d790550d0a
Diffstat (limited to 'compiler/debug')
| -rw-r--r-- | compiler/debug/elf_debug_writer.cc | 27 |
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(), |
