Bug 1245761 (part 2) - Measure JIT compartments. r=jandem.

--HG--
extra : rebase_source : cc6d1c57306405cdaada9ff876256b8eb2dad03f
This commit is contained in:
Nicholas Nethercote 2016-02-04 17:36:06 +11:00
parent e58e7cfd62
commit 3a94c4149a
7 changed files with 25 additions and 4 deletions

View File

@ -712,7 +712,8 @@ struct CompartmentStats
macro(Other, MallocHeap, crossCompartmentWrappersTable) \
macro(Other, MallocHeap, regexpCompartment) \
macro(Other, MallocHeap, savedStacksSet) \
macro(Other, MallocHeap, nonSyntacticLexicalScopesTable)
macro(Other, MallocHeap, nonSyntacticLexicalScopesTable) \
macro(Other, MallocHeap, jitCompartment)
CompartmentStats()
: FOR_EACH_SIZE(ZERO_SIZE)

View File

@ -773,6 +773,15 @@ JitCompartment::toggleBarriers(bool enabled)
}
}
size_t
JitCompartment::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const
{
size_t n = mallocSizeOf(this);
if (stubCodes_)
n += stubCodes_->sizeOfIncludingThis(mallocSizeOf);
return n;
}
JitCode*
JitRuntime::getBailoutTable(const FrameSizeClass& frameClass) const
{

View File

@ -525,6 +525,8 @@ class JitCompartment
regExpTesterStub_ = generateRegExpTesterStub(cx);
return regExpTesterStub_ != nullptr;
}
size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf) const;
};
// Called from JSCompartment::discardJitCode().

View File

@ -1113,7 +1113,8 @@ JSCompartment::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
size_t* crossCompartmentWrappersArg,
size_t* regexpCompartment,
size_t* savedStacksSet,
size_t* nonSyntacticLexicalScopesArg)
size_t* nonSyntacticLexicalScopesArg,
size_t* jitCompartment)
{
*compartmentObject += mallocSizeOf(this);
objectGroups.addSizeOfExcludingThis(mallocSizeOf, tiAllocationSiteTables,
@ -1131,6 +1132,8 @@ JSCompartment::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf,
*savedStacksSet += savedStacks_.sizeOfExcludingThis(mallocSizeOf);
if (nonSyntacticLexicalScopes_)
*nonSyntacticLexicalScopesArg += nonSyntacticLexicalScopes_->sizeOfIncludingThis(mallocSizeOf);
if (jitCompartment_)
*jitCompartment += jitCompartment_->sizeOfIncludingThis(mallocSizeOf);
}
void

View File

@ -411,7 +411,8 @@ struct JSCompartment
size_t* crossCompartmentWrappers,
size_t* regexpCompartment,
size_t* savedStacksSet,
size_t* nonSyntacticLexicalScopes);
size_t* nonSyntacticLexicalScopes,
size_t* jitCompartment);
/*
* Shared scope property tree, and arena-pool for allocating its nodes.

View File

@ -343,7 +343,8 @@ StatsCompartmentCallback(JSRuntime* rt, void* data, JSCompartment* compartment)
&cStats.crossCompartmentWrappersTable,
&cStats.regexpCompartment,
&cStats.savedStacksSet,
&cStats.nonSyntacticLexicalScopesTable);
&cStats.nonSyntacticLexicalScopesTable,
&cStats.jitCompartment);
}
static void

View File

@ -2374,6 +2374,10 @@ ReportCompartmentStats(const JS::CompartmentStats& cStats,
cStats.nonSyntacticLexicalScopesTable,
"The non-syntactic lexical scopes table.");
ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("jit-compartment"),
cStats.jitCompartment,
"The JIT compartment.");
if (sundriesGCHeap > 0) {
// We deliberately don't use ZCREPORT_GC_BYTES here.
REPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("sundries/gc-heap"),