Bug 945152 - Part 2: Report mapped array buffer statistics for about:memory. r=njn

This commit is contained in:
Shian-Yow Wu 2014-03-13 14:32:16 +08:00
Родитель ce6586e24c
Коммит 50520fcec3
3 изменённых файлов: 9 добавлений и 0 удалений

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

@ -123,6 +123,7 @@ struct ObjectsExtraSizes
macro(Objects, NotLiveGCThing, mallocHeapElementsNonAsmJS) \ macro(Objects, NotLiveGCThing, mallocHeapElementsNonAsmJS) \
macro(Objects, NotLiveGCThing, mallocHeapElementsAsmJS) \ macro(Objects, NotLiveGCThing, mallocHeapElementsAsmJS) \
macro(Objects, NotLiveGCThing, nonHeapElementsAsmJS) \ macro(Objects, NotLiveGCThing, nonHeapElementsAsmJS) \
macro(Objects, NotLiveGCThing, nonHeapElementsMapped) \
macro(Objects, NotLiveGCThing, nonHeapCodeAsmJS) \ macro(Objects, NotLiveGCThing, nonHeapCodeAsmJS) \
macro(Objects, NotLiveGCThing, mallocHeapAsmJSModuleData) \ macro(Objects, NotLiveGCThing, mallocHeapAsmJSModuleData) \
macro(Objects, NotLiveGCThing, mallocHeapArgumentsData) \ macro(Objects, NotLiveGCThing, mallocHeapArgumentsData) \

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

@ -5908,6 +5908,8 @@ JSObject::addSizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::Objects
#else #else
sizes->mallocHeapElementsAsmJS += mallocSizeOf(elements); sizes->mallocHeapElementsAsmJS += mallocSizeOf(elements);
#endif #endif
} else if (MOZ_UNLIKELY(elements->isMappedArrayBuffer())) {
sizes->nonHeapElementsMapped += as<ArrayBufferObject>().byteLength();
} else { } else {
sizes->mallocHeapElementsNonAsmJS += mallocSizeOf(elements); sizes->mallocHeapElementsNonAsmJS += mallocSizeOf(elements);
} }

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

@ -2139,6 +2139,12 @@ ReportCompartmentStats(const JS::CompartmentStats &cStats,
"the GC heap."); "the GC heap.");
} }
if (cStats.objectsExtra.nonHeapElementsMapped > 0) {
REPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects/non-heap/elements/mapped"),
KIND_NONHEAP, cStats.objectsExtra.nonHeapElementsMapped,
"Memory-mapped array buffer elements.");
}
REPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects/non-heap/code/asm.js"), REPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects/non-heap/code/asm.js"),
KIND_NONHEAP, cStats.objectsExtra.nonHeapCodeAsmJS, KIND_NONHEAP, cStats.objectsExtra.nonHeapCodeAsmJS,
"AOT-compiled asm.js code."); "AOT-compiled asm.js code.");