diff options
author | Greg Clayton <gclayton@apple.com> | 2010-09-15 08:33:30 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-09-15 08:33:30 +0000 |
commit | d88d759a74f1b79cdd45b27f5c1c56cf2d0a472e (patch) | |
tree | fe6ab655ca6d1f73ed87749b6b97a65bb5e3e9e0 /lldb/source/Core/DataExtractor.cpp | |
parent | c288cda3d5259e5c73e29fdbc5d2499c37427364 (diff) | |
download | bcm5719-llvm-d88d759a74f1b79cdd45b27f5c1c56cf2d0a472e.tar.gz bcm5719-llvm-d88d759a74f1b79cdd45b27f5c1c56cf2d0a472e.zip |
15-20% speed improvement when parsing DWARF. I used instruments to
find the hotspots in our code when indexing the DWARF. A combination of
using SmallVector to avoid collection allocations, using fixed form
sizes when possible, and optimizing the hot loops contributed to the
speedup.
llvm-svn: 113961
Diffstat (limited to 'lldb/source/Core/DataExtractor.cpp')
-rw-r--r-- | lldb/source/Core/DataExtractor.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index 5b3c1d38991..3840afa9d4b 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -471,6 +471,37 @@ DataExtractor::GetU16 (uint32_t *offset_ptr) const return val; } +uint16_t +DataExtractor::GetU16_unchecked (uint32_t *offset_ptr) const +{ + uint16_t val = (m_byte_order == eByteOrderHost) ? + ReadInt16 (m_start, *offset_ptr) : + ReadSwapInt16(m_start, *offset_ptr); + *offset_ptr += sizeof(val); + return val; +} + +uint32_t +DataExtractor::GetU32_unchecked (uint32_t *offset_ptr) const +{ + uint32_t val = (m_byte_order == eByteOrderHost) ? + ReadInt32 (m_start, *offset_ptr) : + ReadSwapInt32 (m_start, *offset_ptr); + *offset_ptr += sizeof(val); + return val; +} + +uint64_t +DataExtractor::GetU64_unchecked (uint32_t *offset_ptr) const +{ + uint64_t val = (m_byte_order == eByteOrderHost) ? + ReadInt64 (m_start, *offset_ptr) : + ReadSwapInt64 (m_start, *offset_ptr); + *offset_ptr += sizeof(val); + return val; +} + + //---------------------------------------------------------------------- // Extract "count" uint16_t values from the binary data and update // the offset pointed to by "offset_ptr". The extracted data is |