Bug 1448728 part 3 - Remove mention of servo in memory report as it's the only style system now. r=njn
authorXidorn Quan <me@upsuper.org>
Wed, 28 Mar 2018 10:44:49 +1100
changeset 410327 15226faf044480c2643f65029948137cfecf4bd3
parent 410326 6fef911c55712aa43a0c730a9fe83d120181389f
child 410328 09df78447c1ac233cea9ec28809c79531224d6a4
push id101451
push userxquan@mozilla.com
push dateTue, 27 Mar 2018 23:45:41 +0000
treeherdermozilla-inbound@15226faf0444 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1448728
milestone61.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 1448728 part 3 - Remove mention of servo in memory report as it's the only style system now. r=njn MozReview-Commit-ID: CJl0LboV1Gj
dom/base/Element.cpp
dom/base/nsWindowMemoryReporter.cpp
dom/base/nsWindowSizes.h
layout/style/ServoBindings.cpp
layout/style/ServoStyleSet.cpp
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -4357,17 +4357,17 @@ MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(Serv
 
 void
 Element::AddSizeOfExcludingThis(nsWindowSizes& aSizes, size_t* aNodeSize) const
 {
   FragmentOrElement::AddSizeOfExcludingThis(aSizes, aNodeSize);
 
   if (HasServoData()) {
     // Measure the ElementData object itself.
-    aSizes.mLayoutServoElementDataObjects +=
+    aSizes.mLayoutElementDataObjects +=
       aSizes.mState.mMallocSizeOf(mServoData.Get());
 
     // Measure mServoData, excluding the ComputedValues. This measurement
     // counts towards the element's size. We use ServoElementMallocSizeOf and
     // ServoElementMallocEnclosingSizeOf rather than |aState.mMallocSizeOf| to
     // better distinguish in DMD's output the memory measured within Servo
     // code.
     *aNodeSize +=
--- a/dom/base/nsWindowMemoryReporter.cpp
+++ b/dom/base/nsWindowMemoryReporter.cpp
@@ -353,48 +353,46 @@ CollectWindowReports(nsGlobalWindowInner
   REPORT_SIZE("/layout/style-sheets", mLayoutStyleSheetsSize,
               "Memory used by style sheets within a window.");
 
   REPORT_SIZE("/layout/pres-shell", mLayoutPresShellSize,
               "Memory used by layout's PresShell, along with any structures "
               "allocated in its arena and not measured elsewhere, "
               "within a window.");
 
-  REPORT_SIZE("/layout/servo-style-sets/stylist/rule-tree",
-              mLayoutServoStyleSetsStylistRuleTree,
-              "Memory used by rule trees within Servo style sets within a "
-              "window.");
+  REPORT_SIZE("/layout/style-sets/stylist/rule-tree",
+              mLayoutStyleSetsStylistRuleTree,
+              "Memory used by rule trees within style sets within a window.");
 
-  REPORT_SIZE("/layout/servo-style-sets/stylist/element-and-pseudos-maps",
-              mLayoutServoStyleSetsStylistElementAndPseudosMaps,
-              "Memory used by element and pseudos maps within Servo style "
+  REPORT_SIZE("/layout/style-sets/stylist/element-and-pseudos-maps",
+              mLayoutStyleSetsStylistElementAndPseudosMaps,
+              "Memory used by element and pseudos maps within style "
               "sets within a window.");
 
-  REPORT_SIZE("/layout/servo-style-sets/stylist/invalidation-map",
-              mLayoutServoStyleSetsStylistInvalidationMap,
-              "Memory used by invalidation maps within Servo style sets "
+  REPORT_SIZE("/layout/style-sets/stylist/invalidation-map",
+              mLayoutStyleSetsStylistInvalidationMap,
+              "Memory used by invalidation maps within style sets "
               "within a window.");
 
-  REPORT_SIZE("/layout/servo-style-sets/stylist/revalidation-selectors",
-              mLayoutServoStyleSetsStylistRevalidationSelectors,
-              "Memory used by selectors for cache revalidation within Servo "
+  REPORT_SIZE("/layout/style-sets/stylist/revalidation-selectors",
+              mLayoutStyleSetsStylistRevalidationSelectors,
+              "Memory used by selectors for cache revalidation within "
               "style sets within a window.");
 
-  REPORT_SIZE("/layout/servo-style-sets/stylist/other",
-              mLayoutServoStyleSetsStylistOther,
-              "Memory used by other Stylist data within Servo style sets "
+  REPORT_SIZE("/layout/style-sets/stylist/other",
+              mLayoutStyleSetsStylistOther,
+              "Memory used by other Stylist data within style sets "
               "within a window.");
 
-  REPORT_SIZE("/layout/servo-style-sets/other", mLayoutServoStyleSetsOther,
-              "Memory used by other parts of Servo style sets within a "
-              "window.");
+  REPORT_SIZE("/layout/style-sets/other", mLayoutStyleSetsOther,
+              "Memory used by other parts of style sets within a window.");
 
-  REPORT_SIZE("/layout/servo-element-data-objects",
-              mLayoutServoElementDataObjects,
-              "Memory used for Servo ElementData objects, but not the things"
+  REPORT_SIZE("/layout/element-data-objects",
+              mLayoutElementDataObjects,
+              "Memory used for ElementData objects, but not the things"
               "hanging off them.");
 
   REPORT_SIZE("/layout/text-runs", mLayoutTextRunsSize,
               "Memory used for text-runs (glyph layout) in the PresShell's "
               "frame tree, within a window.");
 
   REPORT_SIZE("/layout/pres-contexts", mLayoutPresContextSize,
               "Memory used for the PresContext in the PresShell's frame "
@@ -474,39 +472,39 @@ CollectWindowReports(nsGlobalWindowInner
 
   if (frameSundriesSize > 0) {
     REPORT_SUM_SIZE(
       "/layout/frames/sundries", frameSundriesSize,
       "The sum of all memory used by frames which were too small to be shown "
       "individually.");
   }
 
-  // This is the Servo style structs.
-  size_t servoStyleSundriesSize = 0;
+  // This is the style structs.
+  size_t styleSundriesSize = 0;
 #define STYLE_STRUCT(name_) \
   { \
-    size_t size = windowSizes.mServoStyleSizes.NS_STYLE_SIZES_FIELD(name_); \
+    size_t size = windowSizes.mStyleSizes.NS_STYLE_SIZES_FIELD(name_); \
     if (size < STYLE_SUNDRIES_THRESHOLD) { \
-      servoStyleSundriesSize += size; \
+      styleSundriesSize += size; \
     } else { \
       REPORT_SUM_SIZE( \
-        "/layout/servo-style-structs/" # name_, size, \
-        "Memory used by the " #name_ " Servo style structs within a window."); \
+        "/layout/style-structs/" # name_, size, \
+        "Memory used by the " #name_ " style structs within a window."); \
     } \
-    aWindowTotalSizes->mServoStyleSizes.NS_STYLE_SIZES_FIELD(name_) += size; \
+    aWindowTotalSizes->mStyleSizes.NS_STYLE_SIZES_FIELD(name_) += size; \
   }
 #define STYLE_STRUCT_LIST_IGNORE_VARIABLES
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 #undef STYLE_STRUCT_LIST_IGNORE_VARIABLES
 
-  if (servoStyleSundriesSize > 0) {
+  if (styleSundriesSize > 0) {
     REPORT_SUM_SIZE(
-      "/layout/servo-style-structs/sundries", servoStyleSundriesSize,
-      "The sum of all memory used by Servo style structs which were too "
+      "/layout/style-structs/sundries", styleSundriesSize,
+      "The sum of all memory used by style structs which were too "
       "small to be shown individually.");
   }
 
 #undef REPORT_SIZE
 #undef REPORT_SUM_SIZE
 #undef REPORT_COUNT
 }
 
@@ -624,28 +622,28 @@ nsWindowMemoryReporter::CollectReports(n
   REPORT("window-objects/layout/style-sheets",
          windowTotalSizes.mLayoutStyleSheetsSize,
          "This is the sum of all windows' 'layout/style-sheets' numbers.");
 
   REPORT("window-objects/layout/pres-shell",
          windowTotalSizes.mLayoutPresShellSize,
          "This is the sum of all windows' 'layout/arenas' numbers.");
 
-  REPORT("window-objects/layout/servo-style-sets",
-         windowTotalSizes.mLayoutServoStyleSetsStylistRuleTree +
-         windowTotalSizes.mLayoutServoStyleSetsStylistElementAndPseudosMaps +
-         windowTotalSizes.mLayoutServoStyleSetsStylistInvalidationMap +
-         windowTotalSizes.mLayoutServoStyleSetsStylistRevalidationSelectors +
-         windowTotalSizes.mLayoutServoStyleSetsStylistOther +
-         windowTotalSizes.mLayoutServoStyleSetsOther,
-         "This is the sum of all windows' 'layout/servo-style-sets/' numbers.");
+  REPORT("window-objects/layout/style-sets",
+         windowTotalSizes.mLayoutStyleSetsStylistRuleTree +
+         windowTotalSizes.mLayoutStyleSetsStylistElementAndPseudosMaps +
+         windowTotalSizes.mLayoutStyleSetsStylistInvalidationMap +
+         windowTotalSizes.mLayoutStyleSetsStylistRevalidationSelectors +
+         windowTotalSizes.mLayoutStyleSetsStylistOther +
+         windowTotalSizes.mLayoutStyleSetsOther,
+         "This is the sum of all windows' 'layout/style-sets/' numbers.");
 
-  REPORT("window-objects/layout/servo-element-data-objects",
-         windowTotalSizes.mLayoutServoElementDataObjects,
-         "This is the sum of all windows' 'layout/servo-element-data-objects' "
+  REPORT("window-objects/layout/element-data-objects",
+         windowTotalSizes.mLayoutElementDataObjects,
+         "This is the sum of all windows' 'layout/element-data-objects' "
          "numbers.");
 
   REPORT("window-objects/layout/text-runs", windowTotalSizes.mLayoutTextRunsSize,
          "This is the sum of all windows' 'layout/text-runs' numbers.");
 
   REPORT("window-objects/layout/pres-contexts",
          windowTotalSizes.mLayoutPresContextSize,
          "This is the sum of all windows' 'layout/pres-contexts' numbers.");
@@ -683,28 +681,28 @@ nsWindowMemoryReporter::CollectReports(n
 #include "nsFrameIdList.h"
 #undef FRAME_ID
 #undef ABSTRACT_FRAME_ID
 
   REPORT("window-objects/layout/frames", frameTotal,
          "Memory used for layout frames within windows. "
          "This is the sum of all windows' 'layout/frames/' numbers.");
 
-  size_t servoStyleTotal = 0;
+  size_t styleTotal = 0;
 #define STYLE_STRUCT(name_) \
-  servoStyleTotal += \
-    windowTotalSizes.mServoStyleSizes.NS_STYLE_SIZES_FIELD(name_);
+  styleTotal += \
+    windowTotalSizes.mStyleSizes.NS_STYLE_SIZES_FIELD(name_);
 #define STYLE_STRUCT_LIST_IGNORE_VARIABLES
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 #undef STYLE_STRUCT_LIST_IGNORE_VARIABLES
 
-  REPORT("window-objects/layout/servo-style-structs", servoStyleTotal,
+  REPORT("window-objects/layout/style-structs", styleTotal,
          "Memory used for style structs within windows. This is the sum of "
-         "all windows' 'layout/servo-style-structs/' numbers.");
+         "all windows' 'layout/style-structs/' numbers.");
 
 #undef REPORT
 
   return NS_OK;
 }
 
 uint32_t
 nsWindowMemoryReporter::GetGhostTimeout()
--- a/dom/base/nsWindowSizes.h
+++ b/dom/base/nsWindowSizes.h
@@ -170,23 +170,23 @@ class nsWindowSizes
   macro(DOM,   mDOMCDATANodesSize) \
   macro(DOM,   mDOMCommentNodesSize) \
   macro(DOM,   mDOMEventTargetsSize) \
   macro(DOM,   mDOMPerformanceUserEntries) \
   macro(DOM,   mDOMPerformanceResourceEntries) \
   macro(DOM,   mDOMOtherSize) \
   macro(Style, mLayoutStyleSheetsSize) \
   macro(Other, mLayoutPresShellSize) \
-  macro(Style, mLayoutServoStyleSetsStylistRuleTree) \
-  macro(Style, mLayoutServoStyleSetsStylistElementAndPseudosMaps) \
-  macro(Style, mLayoutServoStyleSetsStylistInvalidationMap) \
-  macro(Style, mLayoutServoStyleSetsStylistRevalidationSelectors) \
-  macro(Style, mLayoutServoStyleSetsStylistOther) \
-  macro(Style, mLayoutServoStyleSetsOther) \
-  macro(Style, mLayoutServoElementDataObjects) \
+  macro(Style, mLayoutStyleSetsStylistRuleTree) \
+  macro(Style, mLayoutStyleSetsStylistElementAndPseudosMaps) \
+  macro(Style, mLayoutStyleSetsStylistInvalidationMap) \
+  macro(Style, mLayoutStyleSetsStylistRevalidationSelectors) \
+  macro(Style, mLayoutStyleSetsStylistOther) \
+  macro(Style, mLayoutStyleSetsOther) \
+  macro(Style, mLayoutElementDataObjects) \
   macro(Other, mLayoutTextRunsSize) \
   macro(Other, mLayoutPresContextSize) \
   macro(Other, mLayoutFramePropertiesSize) \
   macro(Style, mLayoutComputedValuesDom) \
   macro(Style, mLayoutComputedValuesNonDom) \
   macro(Style, mLayoutComputedValuesVisited) \
   macro(Style, mLayoutComputedValuesStale) \
   macro(Other, mPropertyTablesSize) \
@@ -194,45 +194,45 @@ class nsWindowSizes
 
 public:
   explicit nsWindowSizes(mozilla::SizeOfState& aState)
     :
       FOR_EACH_SIZE(ZERO_SIZE)
       mDOMEventTargetsCount(0),
       mDOMEventListenersCount(0),
       mArenaSizes(),
-      mServoStyleSizes(),
+      mStyleSizes(),
       mState(aState)
   {}
 
   void addToTabSizes(nsTabSizes* aSizes) const {
     FOR_EACH_SIZE(ADD_TO_TAB_SIZES)
     mArenaSizes.addToTabSizes(aSizes);
-    mServoStyleSizes.addToTabSizes(aSizes);
+    mStyleSizes.addToTabSizes(aSizes);
   }
 
   size_t getTotalSize() const
   {
     size_t total = 0;
 
     FOR_EACH_SIZE(ADD_TO_TOTAL_SIZE)
     total += mArenaSizes.getTotalSize();
-    total += mServoStyleSizes.getTotalSize();
+    total += mStyleSizes.getTotalSize();
 
     return total;
   }
 
   FOR_EACH_SIZE(DECL_SIZE);
 
   uint32_t mDOMEventTargetsCount;
   uint32_t mDOMEventListenersCount;
 
   nsArenaSizes mArenaSizes;
 
-  nsStyleSizes mServoStyleSizes;
+  nsStyleSizes mStyleSizes;
 
   mozilla::SizeOfState& mState;
 
 #undef FOR_EACH_SIZE
 };
 
 #undef ZERO_SIZE
 #undef ADD_TO_TAB_SIZES
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -221,17 +221,17 @@ ServoComputedData::AddSizeOfExcludingThi
   // to measure it with a function that can handle an interior pointer. We use
   // ServoStyleStructsEnclosingMallocSizeOf to clearly identify in DMD's
   // output the memory measured here.
 #define STYLE_STRUCT(name_) \
   static_assert(alignof(nsStyle##name_) <= sizeof(size_t), \
                 "alignment will break AddSizeOfExcludingThis()"); \
   const void* p##name_ = GetStyle##name_(); \
   if (!aSizes.mState.HaveSeenPtr(p##name_)) { \
-    aSizes.mServoStyleSizes.NS_STYLE_SIZES_FIELD(name_) += \
+    aSizes.mStyleSizes.NS_STYLE_SIZES_FIELD(name_) += \
       ServoStyleStructsMallocEnclosingSizeOf(p##name_); \
   }
   #define STYLE_STRUCT_LIST_IGNORE_VARIABLES
 #include "nsStyleStructList.h"
 #undef STYLE_STRUCT
 #undef STYLE_STRUCT_LIST_IGNORE_VARIABLES
 
   if (visited_style.mPtr && !aSizes.mState.HaveSeenPtr(visited_style.mPtr)) {
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -336,44 +336,44 @@ ServoStyleSet::MediumFeaturesChanged(Med
 MOZ_DEFINE_MALLOC_SIZE_OF(ServoStyleSetMallocSizeOf)
 MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(ServoStyleSetMallocEnclosingSizeOf)
 
 void
 ServoStyleSet::AddSizeOfIncludingThis(nsWindowSizes& aSizes) const
 {
   MallocSizeOf mallocSizeOf = aSizes.mState.mMallocSizeOf;
 
-  aSizes.mLayoutServoStyleSetsOther += mallocSizeOf(this);
+  aSizes.mLayoutStyleSetsOther += mallocSizeOf(this);
 
   if (mRawSet) {
-    aSizes.mLayoutServoStyleSetsOther += mallocSizeOf(mRawSet.get());
+    aSizes.mLayoutStyleSetsOther += mallocSizeOf(mRawSet.get());
     ServoStyleSetSizes sizes;
     // Measure mRawSet. We use ServoStyleSetMallocSizeOf rather than
     // aMallocSizeOf to distinguish in DMD's output the memory measured within
     // Servo code.
     Servo_StyleSet_AddSizeOfExcludingThis(ServoStyleSetMallocSizeOf,
                                           ServoStyleSetMallocEnclosingSizeOf,
                                           &sizes, mRawSet.get());
 
     // The StyleSet does not contain precomputed pseudos; they are in the UA
     // cache.
     MOZ_RELEASE_ASSERT(sizes.mPrecomputedPseudos == 0);
 
-    aSizes.mLayoutServoStyleSetsStylistRuleTree += sizes.mRuleTree;
-    aSizes.mLayoutServoStyleSetsStylistElementAndPseudosMaps +=
+    aSizes.mLayoutStyleSetsStylistRuleTree += sizes.mRuleTree;
+    aSizes.mLayoutStyleSetsStylistElementAndPseudosMaps +=
       sizes.mElementAndPseudosMaps;
-    aSizes.mLayoutServoStyleSetsStylistInvalidationMap +=
+    aSizes.mLayoutStyleSetsStylistInvalidationMap +=
       sizes.mInvalidationMap;
-    aSizes.mLayoutServoStyleSetsStylistRevalidationSelectors +=
+    aSizes.mLayoutStyleSetsStylistRevalidationSelectors +=
       sizes.mRevalidationSelectors;
-    aSizes.mLayoutServoStyleSetsStylistOther += sizes.mOther;
+    aSizes.mLayoutStyleSetsStylistOther += sizes.mOther;
   }
 
   if (mStyleRuleMap) {
-    aSizes.mLayoutServoStyleSetsOther +=
+    aSizes.mLayoutStyleSetsOther +=
       mStyleRuleMap->SizeOfIncludingThis(aSizes.mState.mMallocSizeOf);
   }
 
   // Measurement of the following members may be added later if DMD finds it is
   // worthwhile:
   // - mSheets
   // - mNonInheritingComputedStyles
   //