Bug 1484828 - Rename some fields in EHABIStackWalk.cpp. r=jld
authorMarkus Stange <mstange@themasta.com>
Wed, 03 Oct 2018 02:23:09 +0000
changeset 495077 5af47e5b67f0618aab9cd47b4483f2a32458be61
parent 495076 9d52b6dad6f59f799071ffc14001e1a430d78e7a
child 495078 9b246aa2b9cd23f627c701d8ac8ed9cb705f1a2b
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjld
bugs1484828
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1484828 - Rename some fields in EHABIStackWalk.cpp. r=jld Depends on D3834 Differential Revision: https://phabricator.services.mozilla.com/D3835
tools/profiler/core/EHABIStackWalk.cpp
--- a/tools/profiler/core/EHABIStackWalk.cpp
+++ b/tools/profiler/core/EHABIStackWalk.cpp
@@ -102,17 +102,17 @@ public:
 bool operator<(const EHEntryHandle &lhs, const EHEntryHandle &rhs) {
   return lhs.value()->startPC.compute() < rhs.value()->startPC.compute();
 }
 #endif
 
 class EHTable {
   uint32_t mStartPC;
   uint32_t mEndPC;
-  uint32_t mLoadOffset;
+  uint32_t mBaseAddress;
 #ifdef HAVE_UNSORTED_EXIDX
   // In principle we should be able to binary-search the index section in
   // place, but the ICS toolchain's linker is noncompliant and produces
   // indices that aren't entirely sorted (e.g., libc).  So we have this:
   std::vector<EHEntryHandle> mEntries;
   typedef std::vector<EHEntryHandle>::const_iterator EntryIterator;
   EntryIterator entriesBegin() const { return mEntries.begin(); }
   EntryIterator entriesEnd() const { return mEntries.end(); }
@@ -129,17 +129,17 @@ class EHTable {
   std::string mName;
 public:
   EHTable(const void *aELF, size_t aSize, const std::string &aName);
   const EHEntry *lookup(uint32_t aPC) const;
   bool isValid() const { return entriesEnd() != entriesBegin(); }
   const std::string &name() const { return mName; }
   uint32_t startPC() const { return mStartPC; }
   uint32_t endPC() const { return mEndPC; }
-  uint32_t loadOffset() const { return mLoadOffset; }
+  uint32_t baseAddress() const { return mBaseAddress; }
 };
 
 class EHAddrSpace {
   std::vector<uint32_t> mStarts;
   std::vector<EHTable> mTables;
   static mozilla::Atomic<const EHAddrSpace*> sCurrent;
 public:
   explicit EHAddrSpace(const std::vector<EHTable>& aTables);
@@ -543,22 +543,22 @@ EHTable::EHTable(const void *aELF, size_
   : mStartPC(~0), // largest uint32_t
     mEndPC(0),
 #ifndef HAVE_UNSORTED_EXIDX
     mEntriesBegin(nullptr),
     mEntriesEnd(nullptr),
 #endif
     mName(aName)
 {
-  const uint32_t base = reinterpret_cast<uint32_t>(aELF);
+  const uint32_t fileHeaderAddr = reinterpret_cast<uint32_t>(aELF);
 
   if (aSize < sizeof(Elf32_Ehdr))
     return;
 
-  const Elf32_Ehdr &file = *(reinterpret_cast<Elf32_Ehdr *>(base));
+  const Elf32_Ehdr &file = *(reinterpret_cast<Elf32_Ehdr *>(fileHeaderAddr));
   if (memcmp(&file.e_ident[EI_MAG0], ELFMAG, SELFMAG) != 0 ||
       file.e_ident[EI_CLASS] != ELFCLASS32 ||
       file.e_ident[EI_DATA] != hostEndian ||
       file.e_ident[EI_VERSION] != EV_CURRENT ||
       file.e_ident[EI_OSABI] != ELFOSABI_SYSV ||
 #ifdef EI_ABIVERSION
       file.e_ident[EI_ABIVERSION] != 0 ||
 #endif
@@ -566,17 +566,17 @@ EHTable::EHTable(const void *aELF, size_
       file.e_version != EV_CURRENT)
     // e_flags?
     return;
 
   MOZ_ASSERT(file.e_phoff + file.e_phnum * file.e_phentsize <= aSize);
   const Elf32_Phdr *exidxHdr = 0, *zeroHdr = 0;
   for (unsigned i = 0; i < file.e_phnum; ++i) {
     const Elf32_Phdr &phdr =
-      *(reinterpret_cast<Elf32_Phdr *>(base + file.e_phoff
+      *(reinterpret_cast<Elf32_Phdr *>(fileHeaderAddr + file.e_phoff
                                        + i * file.e_phentsize));
     if (phdr.p_type == PT_ARM_EXIDX) {
       exidxHdr = &phdr;
     } else if (phdr.p_type == PT_LOAD) {
       if (phdr.p_offset == 0) {
         zeroHdr = &phdr;
       }
       if (phdr.p_flags & PF_X) {
@@ -584,25 +584,25 @@ EHTable::EHTable(const void *aELF, size_
         mEndPC = std::max(mEndPC, phdr.p_vaddr + phdr.p_memsz);
       }
     }
   }
   if (!exidxHdr)
     return;
   if (!zeroHdr)
     return;
-  mLoadOffset = base - zeroHdr->p_vaddr;
-  mStartPC += mLoadOffset;
-  mEndPC += mLoadOffset;
+  mBaseAddress = fileHeaderAddr - zeroHdr->p_vaddr;
+  mStartPC += mBaseAddress;
+  mEndPC += mBaseAddress;
 
   // Create a sorted index of the index to work around linker bugs.
   const EHEntry *startTable =
-    reinterpret_cast<const EHEntry *>(mLoadOffset + exidxHdr->p_vaddr);
+    reinterpret_cast<const EHEntry *>(mBaseAddress + exidxHdr->p_vaddr);
   const EHEntry *endTable =
-    reinterpret_cast<const EHEntry *>(mLoadOffset + exidxHdr->p_vaddr
+    reinterpret_cast<const EHEntry *>(mBaseAddress + exidxHdr->p_vaddr
                                     + exidxHdr->p_memsz);
 #ifdef HAVE_UNSORTED_EXIDX
   mEntries.reserve(endTable - startTable);
   for (const EHEntry *i = startTable; i < endTable; ++i)
     mEntries.push_back(i);
   std::sort(mEntries.begin(), mEntries.end());
 #else
   mEntriesBegin = startTable;