Bug 919889 (part 2) - Rename IteratorClosure as StatsClosure. r=luke.

This commit is contained in:
Nicholas Nethercote 2013-09-24 23:24:27 -07:00
parent 2059e24169
commit 619e62bcb6

View File

@ -153,12 +153,12 @@ NotableStringInfo &NotableStringInfo::operator=(MoveRef<NotableStringInfo> info)
typedef HashSet<ScriptSource *, DefaultHasher<ScriptSource *>, SystemAllocPolicy> SourceSet;
struct IteratorClosure
struct StatsClosure
{
RuntimeStats *rtStats;
ObjectPrivateVisitor *opv;
SourceSet seenSources;
IteratorClosure(RuntimeStats *rt, ObjectPrivateVisitor *v) : rtStats(rt), opv(v) {}
StatsClosure(RuntimeStats *rt, ObjectPrivateVisitor *v) : rtStats(rt), opv(v) {}
bool init() {
return seenSources.init();
}
@ -217,7 +217,7 @@ static void
StatsCompartmentCallback(JSRuntime *rt, void *data, JSCompartment *compartment)
{
// Append a new CompartmentStats to the vector.
RuntimeStats *rtStats = static_cast<IteratorClosure *>(data)->rtStats;
RuntimeStats *rtStats = static_cast<StatsClosure *>(data)->rtStats;
// CollectRuntimeStats reserves enough space.
MOZ_ALWAYS_TRUE(rtStats->compartmentStatsVector.growBy(1));
@ -241,7 +241,7 @@ static void
StatsZoneCallback(JSRuntime *rt, void *data, Zone *zone)
{
// Append a new CompartmentStats to the vector.
RuntimeStats *rtStats = static_cast<IteratorClosure *>(data)->rtStats;
RuntimeStats *rtStats = static_cast<StatsClosure *>(data)->rtStats;
// CollectRuntimeStats reserves enough space.
MOZ_ALWAYS_TRUE(rtStats->zoneStatsVector.growBy(1));
@ -257,7 +257,7 @@ static void
StatsArenaCallback(JSRuntime *rt, void *data, gc::Arena *arena,
JSGCTraceKind traceKind, size_t thingSize)
{
RuntimeStats *rtStats = static_cast<IteratorClosure *>(data)->rtStats;
RuntimeStats *rtStats = static_cast<StatsClosure *>(data)->rtStats;
// The admin space includes (a) the header and (b) the padding between the
// end of the header and the start of the first GC thing.
@ -281,7 +281,7 @@ static void
StatsCellCallback(JSRuntime *rt, void *data, void *thing, JSGCTraceKind traceKind,
size_t thingSize)
{
IteratorClosure *closure = static_cast<IteratorClosure *>(data);
StatsClosure *closure = static_cast<StatsClosure *>(data);
RuntimeStats *rtStats = closure->rtStats;
ZoneStats *zStats = rtStats->currZoneStats;
switch (traceKind) {
@ -473,7 +473,7 @@ JS::CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats, ObjectPrivateVisit
DecommittedArenasChunkCallback);
// Take the per-compartment measurements.
IteratorClosure closure(rtStats, opv);
StatsClosure closure(rtStats, opv);
if (!closure.init())
return false;
rtStats->runtime.scriptSources = 0;