Bug 1073594 - Part 2: Remove nsTraceRefcntStats::mRefsOutstanding{Total, Squared}. r=dbaron, a=lizzard
authorAndrew McCreight <continuation@gmail.com>
Wed, 04 Mar 2015 14:07:59 -0800
changeset 248083 ae154f933e659d3f57fc86e927889d7752427139
parent 248082 1abea956f06f654e953b27868879fea02d6771c7
child 248084 d50b1d697c75e6f31b5ce05cac020734edb8fa0f
push id7757
push userryanvm@gmail.com
push dateFri, 13 Mar 2015 21:08:08 +0000
treeherdermozilla-aurora@e60410974749 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, lizzard
bugs1073594
milestone38.0a2
Bug 1073594 - Part 2: Remove nsTraceRefcntStats::mRefsOutstanding{Total, Squared}. r=dbaron, a=lizzard 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)