Bug 1448728 part 2 - Remove style sizes for the old style system from nsWindowSizes.h. r=njn

MozReview-Commit-ID: 5FqJWoCjlto

--HG--
extra : source : 261d5942b8ee9fb178726bef0691d6ec70e72b6c
This commit is contained in:
Xidorn Quan 2018-03-28 10:44:49 +11:00
Родитель 1962625a79
Коммит 160053e9ab
2 изменённых файлов: 3 добавлений и 59 удалений

Просмотреть файл

@ -358,9 +358,6 @@ CollectWindowReports(nsGlobalWindowInner *aWindow,
"allocated in its arena and not measured elsewhere, " "allocated in its arena and not measured elsewhere, "
"within a window."); "within a window.");
REPORT_SIZE("/layout/gecko-style-sets", mLayoutGeckoStyleSets,
"Memory used by Gecko style sets within a window.");
REPORT_SIZE("/layout/servo-style-sets/stylist/rule-tree", REPORT_SIZE("/layout/servo-style-sets/stylist/rule-tree",
mLayoutServoStyleSetsStylistRuleTree, mLayoutServoStyleSetsStylistRuleTree,
"Memory used by rule trees within Servo style sets within a " "Memory used by rule trees within Servo style sets within a "
@ -451,34 +448,6 @@ CollectWindowReports(nsGlobalWindowInner *aWindow,
const size_t STYLE_SUNDRIES_THRESHOLD = const size_t STYLE_SUNDRIES_THRESHOLD =
js::MemoryReportingSundriesThreshold(); js::MemoryReportingSundriesThreshold();
// This is the Gecko style structs, which are in the nsPresArena.
size_t geckoStyleSundriesSize = 0;
#define STYLE_STRUCT(name_) \
{ \
size_t size = \
windowSizes.mArenaSizes.mGeckoStyleSizes.NS_STYLE_SIZES_FIELD(name_); \
if (size < STYLE_SUNDRIES_THRESHOLD) { \
geckoStyleSundriesSize += size; \
} else { \
REPORT_SUM_SIZE( \
"/layout/gecko-style-structs/" # name_, size, \
"Memory used by the " #name_ " Gecko style structs within a window."); \
} \
aWindowTotalSizes->mArenaSizes.mGeckoStyleSizes.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 (geckoStyleSundriesSize > 0) {
REPORT_SUM_SIZE(
"/layout/gecko-style-structs/sundries", geckoStyleSundriesSize,
"The sum of all memory used by Gecko style structs which were too small "
"to be shown individually.");
}
// There are many different kinds of frames, but it is very likely // There are many different kinds of frames, but it is very likely
// that only a few matter. Implement a cutoff so we don't bloat // that only a few matter. Implement a cutoff so we don't bloat
// about:memory with many uninteresting entries. // about:memory with many uninteresting entries.
@ -660,10 +629,6 @@ nsWindowMemoryReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
windowTotalSizes.mLayoutPresShellSize, windowTotalSizes.mLayoutPresShellSize,
"This is the sum of all windows' 'layout/arenas' numbers."); "This is the sum of all windows' 'layout/arenas' numbers.");
REPORT("window-objects/layout/gecko-style-sets",
windowTotalSizes.mLayoutGeckoStyleSets,
"This is the sum of all windows' 'layout/gecko-style-sets' numbers.");
REPORT("window-objects/layout/servo-style-sets", REPORT("window-objects/layout/servo-style-sets",
windowTotalSizes.mLayoutServoStyleSetsStylistRuleTree + windowTotalSizes.mLayoutServoStyleSetsStylistRuleTree +
windowTotalSizes.mLayoutServoStyleSetsStylistElementAndPseudosMaps + windowTotalSizes.mLayoutServoStyleSetsStylistElementAndPseudosMaps +
@ -711,19 +676,6 @@ nsWindowMemoryReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
windowTotalSizes.mArenaSizes.mComputedStyles, windowTotalSizes.mArenaSizes.mComputedStyles,
"This is the sum of all windows' 'layout/style-contexts' numbers."); "This is the sum of all windows' 'layout/style-contexts' numbers.");
size_t geckoStyleTotal = 0;
#define STYLE_STRUCT(name_) \
geckoStyleTotal += \
windowTotalSizes.mArenaSizes.mGeckoStyleSizes.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/gecko-style-structs", geckoStyleTotal,
"Memory used for style structs within windows. This is the sum of "
"all windows' 'layout/gecko-style-structs/' numbers.");
size_t frameTotal = 0; size_t frameTotal = 0;
#define FRAME_ID(classname, ...) \ #define FRAME_ID(classname, ...) \
frameTotal += windowTotalSizes.mArenaSizes.NS_ARENA_SIZES_FIELD(classname); frameTotal += windowTotalSizes.mArenaSizes.NS_ARENA_SIZES_FIELD(classname);

Просмотреть файл

@ -116,7 +116,7 @@ struct nsArenaSizes {
#undef FRAME_ID #undef FRAME_ID
#undef ABSTRACT_FRAME_ID #undef ABSTRACT_FRAME_ID
mGeckoStyleSizes() dummy()
{} {}
void addToTabSizes(nsTabSizes* aSizes) const void addToTabSizes(nsTabSizes* aSizes) const
@ -129,8 +129,6 @@ struct nsArenaSizes {
#include "nsFrameIdList.h" #include "nsFrameIdList.h"
#undef FRAME_ID #undef FRAME_ID
#undef ABSTRACT_FRAME_ID #undef ABSTRACT_FRAME_ID
mGeckoStyleSizes.addToTabSizes(aSizes);
} }
size_t getTotalSize() const size_t getTotalSize() const
@ -146,8 +144,6 @@ struct nsArenaSizes {
#undef FRAME_ID #undef FRAME_ID
#undef ABSTRACT_FRAME_ID #undef ABSTRACT_FRAME_ID
total += mGeckoStyleSizes.getTotalSize();
return total; return total;
} }
@ -160,9 +156,8 @@ struct nsArenaSizes {
#undef FRAME_ID #undef FRAME_ID
#undef ABSTRACT_FRAME_ID #undef ABSTRACT_FRAME_ID
// This is Gecko-only because in Stylo these style structs are stored outside // Present just to absorb the trailing comma in the constructor.
// the nsPresArena, and so measured elsewhere. int dummy;
nsStyleSizes mGeckoStyleSizes;
#undef FOR_EACH_SIZE #undef FOR_EACH_SIZE
}; };
@ -180,7 +175,6 @@ class nsWindowSizes
macro(DOM, mDOMOtherSize) \ macro(DOM, mDOMOtherSize) \
macro(Style, mLayoutStyleSheetsSize) \ macro(Style, mLayoutStyleSheetsSize) \
macro(Other, mLayoutPresShellSize) \ macro(Other, mLayoutPresShellSize) \
macro(Style, mLayoutGeckoStyleSets) \
macro(Style, mLayoutServoStyleSetsStylistRuleTree) \ macro(Style, mLayoutServoStyleSetsStylistRuleTree) \
macro(Style, mLayoutServoStyleSetsStylistElementAndPseudosMaps) \ macro(Style, mLayoutServoStyleSetsStylistElementAndPseudosMaps) \
macro(Style, mLayoutServoStyleSetsStylistInvalidationMap) \ macro(Style, mLayoutServoStyleSetsStylistInvalidationMap) \
@ -233,8 +227,6 @@ public:
nsArenaSizes mArenaSizes; nsArenaSizes mArenaSizes;
// This is Stylo-only because in Gecko these style structs are stored in the
// nsPresArena, and so are measured as part of that.
nsStyleSizes mServoStyleSizes; nsStyleSizes mServoStyleSizes;
mozilla::SizeOfState& mState; mozilla::SizeOfState& mState;