diff options
| author | 2015-09-11 11:59:18 +0100 | |
|---|---|---|
| committer | 2015-10-27 15:13:37 +0000 | |
| commit | 35831e8bfa1c0944d4c978d99c4c5b9577945170 (patch) | |
| tree | a347ecaf4265a1713c86d528392e162d5edfaebc /compiler/elf_writer_debug.cc | |
| parent | 171b12e8060f63cf900ffc43d6db35125f6b8c83 (diff) | |
Reduce memory used by CompiledMethods.
Use LengthPrefixedArray<>s instead of SwapVector<>s to store
CompiledMethod data and get rid of the unnecessary members
of CompiledMethod to reduce dex2oat memory usage. Refactor
the deduplication from CompilerDriver to a new class.
Use HashSet<> instead of std::set<> for the DedupeSet<> to
further decrease the memory usage and improve performance.
This reduces the dex2oat memory usage when compiling boot
image on Nexus 5 (with Optimizing, -j1) by ~6.75MiB (5%).
This also reduces the compile time by ~2.2% (~1.6% dex2oat
time; with Optimizing, without -j).
Change-Id: I974f1f5e58350de2bf487a2bca3907fa05fb80ea
Diffstat (limited to 'compiler/elf_writer_debug.cc')
| -rw-r--r-- | compiler/elf_writer_debug.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/elf_writer_debug.cc b/compiler/elf_writer_debug.cc index c10ffebbbc..3a9e312225 100644 --- a/compiler/elf_writer_debug.cc +++ b/compiler/elf_writer_debug.cc @@ -182,8 +182,8 @@ void WriteCFISection(const CompilerDriver* compiler, WriteDebugFrameCIE(isa, address_type, format, debug_frame); for (const OatWriter::DebugInfo& mi : method_infos) { if (!mi.deduped_) { // Only one FDE per unique address. - const SwapVector<uint8_t>* opcodes = mi.compiled_method_->GetCFIInfo(); - if (opcodes != nullptr) { + ArrayRef<const uint8_t> opcodes = mi.compiled_method_->GetCFIInfo(); + if (!opcodes.empty()) { address_to_fde_offset_map.emplace(mi.low_pc_, debug_frame->size()); WriteDebugFrameFDE(Is64BitInstructionSet(isa), cie_offset, mi.low_pc_, mi.high_pc_ - mi.low_pc_, |