Bug 755581 (part 5) - Add "cross-compartment-wrappers" reporter. r=luke.

--HG--
extra : rebase_source : 1dfb5eb522008acd59f6bce5e1724af1dc0da9f0
This commit is contained in:
Nicholas Nethercote 2012-05-15 19:31:01 -07:00
parent 9e31860570
commit 14ad857e16
3 changed files with 8 additions and 0 deletions

View File

@ -135,6 +135,7 @@ struct CompartmentStats
size_t shapesCompartmentTables;
size_t scriptData;
size_t mjitData;
size_t crossCompartmentWrappers;
TypeInferenceSizes typeInferenceSizes;
};

View File

@ -69,6 +69,8 @@ StatsCompartmentCallback(JSRuntime *rt, void *data, JSCompartment *compartment)
// Get the compartment-level numbers.
compartment->sizeOfTypeInferenceData(&cStats.typeInferenceSizes, rtStats->mallocSizeOf);
cStats.shapesCompartmentTables = compartment->sizeOfShapeTable(rtStats->mallocSizeOf);
cStats.crossCompartmentWrappers =
compartment->crossCompartmentWrappers.sizeOfExcludingThis(rtStats->mallocSizeOf);
}
static void

View File

@ -1487,6 +1487,11 @@ ReportCompartmentStats(const JS::CompartmentStats &cStats,
"compilation data: JITScripts, native maps, and inline "
"cache structs.");
REPORT_BYTES0(MakePath(pathPrefix, cStats, "cross-compartment-wrappers"),
nsIMemoryReporter::KIND_HEAP, cStats.crossCompartmentWrappers,
"Memory used by the compartment's cross-compartment "
"wrappers.");
REPORT_BYTES0(MakePath(pathPrefix, cStats, "type-inference/script-main"),
nsIMemoryReporter::KIND_HEAP,
cStats.typeInferenceSizes.scripts,