OSDN Git Service

[dsymutil] Introduce a new CachedBinaryHolder
authorJonas Devlieghere <jonas@devlieghere.com>
Fri, 29 Jun 2018 16:50:41 +0000 (16:50 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Fri, 29 Jun 2018 16:50:41 +0000 (16:50 +0000)
commit4d3e6c13b683b158016e38aa7ba3ff9e2f8972b0
tree85b4be2ee4ead18a80abf62f8410a0938d8675ed
parentada03192b6d646bc116679e2cbe8424c093b486a
[dsymutil] Introduce a new CachedBinaryHolder

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.

Differential revision: https://reviews.llvm.org/D48501

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335990 91177308-0d34-0410-b5e6-96231b3b80d8
tools/dsymutil/BinaryHolder.cpp
tools/dsymutil/BinaryHolder.h
tools/dsymutil/DwarfLinker.cpp
tools/dsymutil/DwarfLinker.h
tools/dsymutil/dsymutil.cpp
tools/dsymutil/dsymutil.h