Bug 1073594, part 2 - Remove nsTraceRefcntStats::mRefsOutstanding{Total, Squared}. r=dbaron
authorAndrew McCreight <continuation@gmail.com>
Wed, 04 Mar 2015 14:07:59 -0800
changeset 231906 25e5a9346a6af24861e7daf853e49519e18d3b99
parent 231905 9f6d6c54a10dcb30ad909609ccec249dc594c25a
child 231907 ac6e3fccc155442c12875b856e48e0c9e4bcb094
push id56387
push useramccreight@mozilla.com
push dateWed, 04 Mar 2015 22:08:14 +0000
treeherdermozilla-inbound@1d9cead20b3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1073594
milestone39.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 1073594, part 2 - Remove nsTraceRefcntStats::mRefsOutstanding{Total, Squared}. r=dbaron They are now unused.
xpcom/base/nsTraceRefcnt.cpp
--- a/xpcom/base/nsTraceRefcnt.cpp
+++ b/xpcom/base/nsTraceRefcnt.cpp
@@ -113,18 +113,16 @@ struct serialNumberRecord
 };
 
 struct nsTraceRefcntStats
 {
   uint64_t mAddRefs;
   uint64_t mReleases;
   uint64_t mCreates;
   uint64_t mDestroys;
-  double mRefsOutstandingTotal;
-  double mRefsOutstandingSquared;
   double mObjsOutstandingTotal;
   double mObjsOutstandingSquared;
 };
 
 #ifdef DEBUG
 static const char kStaticCtorDtorWarning[] =
   "XPCOM objects created/destroyed from static ctor/dtor";
 
@@ -274,72 +272,59 @@ public:
   }
 
   static void Clear(nsTraceRefcntStats* aStats)
   {
     aStats->mAddRefs = 0;
     aStats->mReleases = 0;
     aStats->mCreates = 0;
     aStats->mDestroys = 0;
-    aStats->mRefsOutstandingTotal = 0;
-    aStats->mRefsOutstandingSquared = 0;
     aStats->mObjsOutstandingTotal = 0;
     aStats->mObjsOutstandingSquared = 0;
   }
 
   void Accumulate()
   {
     mAllStats.mAddRefs += mNewStats.mAddRefs;
     mAllStats.mReleases += mNewStats.mReleases;
     mAllStats.mCreates += mNewStats.mCreates;
     mAllStats.mDestroys += mNewStats.mDestroys;
-    mAllStats.mRefsOutstandingTotal += mNewStats.mRefsOutstandingTotal;
-    mAllStats.mRefsOutstandingSquared += mNewStats.mRefsOutstandingSquared;
     mAllStats.mObjsOutstandingTotal += mNewStats.mObjsOutstandingTotal;
     mAllStats.mObjsOutstandingSquared += mNewStats.mObjsOutstandingSquared;
     Clear(&mNewStats);
   }
 
   void AddRef(nsrefcnt aRefcnt)
   {
     mNewStats.mAddRefs++;
     if (aRefcnt == 1) {
       Ctor();
     }
-    AccountRefs();
   }
 
   void Release(nsrefcnt aRefcnt)
   {
     mNewStats.mReleases++;
     if (aRefcnt == 0) {
       Dtor();
     }
-    AccountRefs();
   }
 
   void Ctor()
   {
     mNewStats.mCreates++;
     AccountObjs();
   }
 
   void Dtor()
   {
     mNewStats.mDestroys++;
     AccountObjs();
   }
 
-  void AccountRefs()
-  {
-    uint64_t cnt = (mNewStats.mAddRefs - mNewStats.mReleases);
-    mNewStats.mRefsOutstandingTotal += cnt;
-    mNewStats.mRefsOutstandingSquared += cnt * cnt;
-  }
-
   void AccountObjs()
   {
     uint64_t cnt = (mNewStats.mCreates - mNewStats.mDestroys);
     mNewStats.mObjsOutstandingTotal += cnt;
     mNewStats.mObjsOutstandingSquared += cnt * cnt;
   }
 
   static int DumpEntry(PLHashEntry* aHashEntry, int aIndex, void* aArg)
@@ -362,20 +347,16 @@ public:
   }
 
   void Total(BloatEntry* aTotal)
   {
     aTotal->mAllStats.mAddRefs += mNewStats.mAddRefs + mAllStats.mAddRefs;
     aTotal->mAllStats.mReleases += mNewStats.mReleases + mAllStats.mReleases;
     aTotal->mAllStats.mCreates += mNewStats.mCreates + mAllStats.mCreates;
     aTotal->mAllStats.mDestroys += mNewStats.mDestroys + mAllStats.mDestroys;
-    aTotal->mAllStats.mRefsOutstandingTotal +=
-      mNewStats.mRefsOutstandingTotal + mAllStats.mRefsOutstandingTotal;
-    aTotal->mAllStats.mRefsOutstandingSquared +=
-      mNewStats.mRefsOutstandingSquared + mAllStats.mRefsOutstandingSquared;
     aTotal->mAllStats.mObjsOutstandingTotal +=
       mNewStats.mObjsOutstandingTotal + mAllStats.mObjsOutstandingTotal;
     aTotal->mAllStats.mObjsOutstandingSquared +=
       mNewStats.mObjsOutstandingSquared + mAllStats.mObjsOutstandingSquared;
     uint64_t count = (mNewStats.mCreates + mAllStats.mCreates);
     aTotal->mClassSize += mClassSize * count;    // adjust for average in DumpTotal
     aTotal->mTotalLeaked += (uint64_t)(mClassSize *
                                        ((mNewStats.mCreates + mAllStats.mCreates)