Bug 921923 (part 1) - Reorder StatsZoneCallback and StatsCompartmentCallback. r=till.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 30 Sep 2013 16:20:07 -0700
changeset 149389 71c3fc0820385bef18b05957301075d7a02ea7b6
parent 149388 df6ac934dd989bfd9afe2b3e6c2672c099f5d8c2
child 149390 bfcf75eac94306dc47f455f3eb33445558cc88ef
push id34546
push usernnethercote@mozilla.com
push dateTue, 01 Oct 2013 02:34:33 +0000
treeherdermozilla-inbound@613810e31754 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs921923
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 921923 (part 1) - Reorder StatsZoneCallback and StatsCompartmentCallback. r=till.
js/src/vm/MemoryMetrics.cpp
--- a/js/src/vm/MemoryMetrics.cpp
+++ b/js/src/vm/MemoryMetrics.cpp
@@ -176,16 +176,32 @@ DecommittedArenasChunkCallback(JSRuntime
         if (chunk->decommittedArenas.get(i))
             n += gc::ArenaSize;
     }
     JS_ASSERT(n > 0);
     *static_cast<size_t *>(data) += n;
 }
 
 static void
+StatsZoneCallback(JSRuntime *rt, void *data, Zone *zone)
+{
+    // Append a new CompartmentStats to the vector.
+    RuntimeStats *rtStats = static_cast<StatsClosure *>(data)->rtStats;
+
+    // CollectRuntimeStats reserves enough space.
+    MOZ_ALWAYS_TRUE(rtStats->zoneStatsVector.growBy(1));
+    ZoneStats &zStats = rtStats->zoneStatsVector.back();
+    rtStats->initExtraZoneStats(zone, &zStats);
+    rtStats->currZoneStats = &zStats;
+
+    zone->sizeOfIncludingThis(rtStats->mallocSizeOf_,
+                              &zStats.typePool);
+}
+
+static void
 StatsCompartmentCallback(JSRuntime *rt, void *data, JSCompartment *compartment)
 {
     // Append a new CompartmentStats to the vector.
     RuntimeStats *rtStats = static_cast<StatsClosure *>(data)->rtStats;
 
     // CollectRuntimeStats reserves enough space.
     MOZ_ALWAYS_TRUE(rtStats->compartmentStatsVector.growBy(1));
     CompartmentStats &cStats = rtStats->compartmentStatsVector.back();
@@ -200,32 +216,16 @@ StatsCompartmentCallback(JSRuntime *rt, 
                                      &cStats.shapesMallocHeapCompartmentTables,
                                      &cStats.crossCompartmentWrappersTable,
                                      &cStats.regexpCompartment,
                                      &cStats.debuggeesSet,
                                      &cStats.baselineStubsOptimized);
 }
 
 static void
-StatsZoneCallback(JSRuntime *rt, void *data, Zone *zone)
-{
-    // Append a new CompartmentStats to the vector.
-    RuntimeStats *rtStats = static_cast<StatsClosure *>(data)->rtStats;
-
-    // CollectRuntimeStats reserves enough space.
-    MOZ_ALWAYS_TRUE(rtStats->zoneStatsVector.growBy(1));
-    ZoneStats &zStats = rtStats->zoneStatsVector.back();
-    rtStats->initExtraZoneStats(zone, &zStats);
-    rtStats->currZoneStats = &zStats;
-
-    zone->sizeOfIncludingThis(rtStats->mallocSizeOf_,
-                              &zStats.typePool);
-}
-
-static void
 StatsArenaCallback(JSRuntime *rt, void *data, gc::Arena *arena,
                    JSGCTraceKind traceKind, size_t thingSize)
 {
     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.
     size_t allocationSpace = arena->thingsSpan(thingSize);