зеркало из https://github.com/mozilla/gecko-dev.git
Bug 946781 - part 5 - measure the proto and iface cache from within xpconnect; r=bholley,njn
This commit is contained in:
Родитель
4e5308cf32
Коммит
ae1c027b6b
|
@ -2728,6 +2728,10 @@ JSReporter::CollectReports(WindowPaths *windowPaths,
|
|||
KIND_HEAP, sizeInfo.mScopeAndMapSize,
|
||||
"Memory used by XPConnect scopes.");
|
||||
|
||||
REPORT_BYTES(NS_LITERAL_CSTRING("explicit/xpconnect/proto-iface-cache"),
|
||||
KIND_HEAP, sizeInfo.mProtoAndIfaceCacheSize,
|
||||
"Memory used for prototype and interface binding caches.");
|
||||
|
||||
REPORT_BYTES(NS_LITERAL_CSTRING("explicit/xpconnect/js-component-loader"),
|
||||
KIND_HEAP, jsComponentLoaderSize,
|
||||
"Memory used by XPConnect's JS component loader.");
|
||||
|
|
|
@ -679,6 +679,12 @@ XPCWrappedNativeScope::AddSizeOfIncludingThis(ScopeSizeInfo* scopeSizeInfo)
|
|||
scopeSizeInfo->mScopeAndMapSize +=
|
||||
mWrappedNativeProtoMap->SizeOfIncludingThis(scopeSizeInfo->mMallocSizeOf);
|
||||
|
||||
if (dom::HasProtoAndIfaceArray(mGlobalJSObject)) {
|
||||
dom::ProtoAndIfaceArray* cache = dom::GetProtoAndIfaceArray(mGlobalJSObject);
|
||||
scopeSizeInfo->mProtoAndIfaceCacheSize +=
|
||||
cache->SizeOfIncludingThis(scopeSizeInfo->mMallocSizeOf);
|
||||
}
|
||||
|
||||
// There are other XPCWrappedNativeScope members that could be measured;
|
||||
// the above ones have been seen by DMD to be worth measuring. More stuff
|
||||
// may be added later.
|
||||
|
|
|
@ -1139,10 +1139,14 @@ public:
|
|||
|
||||
struct ScopeSizeInfo {
|
||||
ScopeSizeInfo(mozilla::MallocSizeOf mallocSizeOf)
|
||||
: mMallocSizeOf(mallocSizeOf), mScopeAndMapSize(0) {}
|
||||
: mMallocSizeOf(mallocSizeOf),
|
||||
mScopeAndMapSize(0),
|
||||
mProtoAndIfaceCacheSize(0)
|
||||
{}
|
||||
|
||||
mozilla::MallocSizeOf mMallocSizeOf;
|
||||
size_t mScopeAndMapSize;
|
||||
size_t mProtoAndIfaceCacheSize;
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
Загрузка…
Ссылка в новой задаче