[PATCH] D48501: [dsymutil] Introduce a new CachedBinaryHolder

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 22 11:41:30 PDT 2018


JDevlieghere created this revision.
JDevlieghere added reviewers: friss, aprantl, davide.

The original binary holder has an optimization where it caches a static
library (archive) between consecutive calls to GetObjects. However, the
actual memory buffer wasn't cached between calls.

This made sense when dsymutil was processing objects one after each
other, but when processing them in parallel, several binaries have to be
in memory at the same time. For this reason, every link context
contained a binary holder.

Having one binary holder per context is problematic, because the same
static archive was cached for every object file. Luckily, when the file
is mmap'ed, this was only costing us virtual memory.

This patch introduces a new BinaryHolder variant that is fully cached,
for all the object files it load, as well as the static archives. This
way, we don't have to give up on this optimization of bypassing the
file system. Currently I only updated the uses in the DwarfLinker, but
my goal is to phase out the exisiting BinaryHolder (let's call it the
LegacyBinaryHolder ;-) in favor of this one.


Repository:
  rL LLVM

https://reviews.llvm.org/D48501

Files:
  llvm/tools/dsymutil/BinaryHolder.cpp
  llvm/tools/dsymutil/BinaryHolder.h
  llvm/tools/dsymutil/DwarfLinker.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48501.152526.patch
Type: text/x-patch
Size: 16812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180622/0c9b4f73/attachment.bin>


More information about the llvm-commits mailing list