Bug 920852 (part 4) - Reorder a bunch of stuff. r=till.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 25 Sep 2013 20:17:19 -0700
changeset 148927 6fb1c750791f9d17f12efc2af063875940515e4f
parent 148926 0f1e4c73c5025e98b7112c8798a19730595a60a1
child 148928 6837a1ce616b882f35998d4996d95b2c92023eca
child 148971 3ad5ecf34c9e55a4c7040d0bdd02387ba2495183
push id34384
push usernnethercote@mozilla.com
push dateFri, 27 Sep 2013 03:05:04 +0000
treeherdermozilla-inbound@6fb1c750791f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstill
bugs920852
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 920852 (part 4) - Reorder a bunch of stuff. r=till.
js/public/MemoryMetrics.h
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -69,25 +69,25 @@ enum {
     NotLiveGCThing
 };
 
 struct ZoneStatsPod
 {
 #define FOR_EACH_SIZE(macro) \
     macro(NotLiveGCThing, gcHeapArenaAdmin) \
     macro(NotLiveGCThing, unusedGCThings) \
-    macro(IsLiveGCThing,  stringsNormalGCHeap) \
-    macro(IsLiveGCThing,  stringsShortGCHeap) \
     macro(IsLiveGCThing,  lazyScriptsGCHeap) \
-    macro(IsLiveGCThing,  typeObjectsGCHeap) \
+    macro(NotLiveGCThing, lazyScriptsMallocHeap) \
     macro(IsLiveGCThing,  ionCodesGCHeap) \
-    macro(NotLiveGCThing, stringsNormalMallocHeap) \
-    macro(NotLiveGCThing, lazyScriptsMallocHeap) \
+    macro(IsLiveGCThing,  typeObjectsGCHeap) \
     macro(NotLiveGCThing, typeObjectsMallocHeap) \
-    macro(NotLiveGCThing, typePool)
+    macro(NotLiveGCThing, typePool) \
+    macro(IsLiveGCThing,  stringsShortGCHeap) \
+    macro(IsLiveGCThing,  stringsNormalGCHeap) \
+    macro(NotLiveGCThing, stringsNormalMallocHeap)
 
     ZoneStatsPod()
       : FOR_EACH_SIZE(ZERO_SIZE)
         extra()
     {}
 
     void add(const ZoneStatsPod &other) {
         FOR_EACH_SIZE(ADD_OTHER_SIZE)
@@ -367,26 +367,26 @@ struct ZoneStats : js::ZoneStatsPod
 struct CompartmentStats
 {
 #define FOR_EACH_SIZE(macro) \
     macro(js::IsLiveGCThing,  objectsGCHeapOrdinary) \
     macro(js::IsLiveGCThing,  objectsGCHeapFunction) \
     macro(js::IsLiveGCThing,  objectsGCHeapDenseArray) \
     macro(js::IsLiveGCThing,  objectsGCHeapSlowArray) \
     macro(js::IsLiveGCThing,  objectsGCHeapCrossCompartmentWrapper) \
+    macro(js::NotLiveGCThing, objectsPrivate) \
     macro(js::IsLiveGCThing,  shapesGCHeapTreeGlobalParented) \
     macro(js::IsLiveGCThing,  shapesGCHeapTreeNonGlobalParented) \
     macro(js::IsLiveGCThing,  shapesGCHeapDict) \
     macro(js::IsLiveGCThing,  shapesGCHeapBase) \
-    macro(js::IsLiveGCThing,  scriptsGCHeap) \
-    macro(js::NotLiveGCThing, objectsPrivate) \
     macro(js::NotLiveGCThing, shapesMallocHeapTreeTables) \
     macro(js::NotLiveGCThing, shapesMallocHeapDictTables) \
     macro(js::NotLiveGCThing, shapesMallocHeapTreeShapeKids) \
     macro(js::NotLiveGCThing, shapesMallocHeapCompartmentTables) \
+    macro(js::IsLiveGCThing,  scriptsGCHeap) \
     macro(js::NotLiveGCThing, scriptsMallocHeapData) \
     macro(js::NotLiveGCThing, baselineData) \
     macro(js::NotLiveGCThing, baselineStubsFallback) \
     macro(js::NotLiveGCThing, baselineStubsOptimized) \
     macro(js::NotLiveGCThing, ionData) \
     macro(js::NotLiveGCThing, compartmentObject) \
     macro(js::NotLiveGCThing, crossCompartmentWrappersTable) \
     macro(js::NotLiveGCThing, regexpCompartment) \
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -1757,31 +1757,31 @@ ReportZoneStats(const JS::ZoneStats &zSt
                       "heap taken by empty GC thing slots within non-empty "
                       "arenas.");
 
     ZCREPORT_GC_BYTES(pathPrefix + NS_LITERAL_CSTRING("lazy-scripts/gc-heap"),
                       zStats.lazyScriptsGCHeap,
                       "Memory on the garbage-collected JavaScript "
                       "heap that represents scripts which haven't executed yet.");
 
-    ZCREPORT_GC_BYTES(pathPrefix + NS_LITERAL_CSTRING("type-objects/gc-heap"),
-                      zStats.typeObjectsGCHeap,
-                      "Memory on the garbage-collected JavaScript "
-                      "heap that holds type inference information.");
+    ZCREPORT_BYTES(pathPrefix + NS_LITERAL_CSTRING("lazy-scripts/malloc-heap"),
+                   zStats.lazyScriptsMallocHeap,
+                   "Memory holding miscellaneous additional information associated with lazy "
+                   "scripts.  This memory is allocated on the malloc heap.");
 
     ZCREPORT_GC_BYTES(pathPrefix + NS_LITERAL_CSTRING("ion-codes-gc-heap"),
                       zStats.ionCodesGCHeap,
                       "Memory on the garbage-collected JavaScript "
                       "heap that holds references to executable code pools "
                       "used by the IonMonkey JIT.");
 
-    ZCREPORT_BYTES(pathPrefix + NS_LITERAL_CSTRING("lazy-scripts/malloc-heap"),
-                   zStats.lazyScriptsMallocHeap,
-                   "Memory holding miscellaneous additional information associated with lazy "
-                   "scripts.  This memory is allocated on the malloc heap.");
+    ZCREPORT_GC_BYTES(pathPrefix + NS_LITERAL_CSTRING("type-objects/gc-heap"),
+                      zStats.typeObjectsGCHeap,
+                      "Memory on the garbage-collected JavaScript "
+                      "heap that holds type inference information.");
 
     ZCREPORT_BYTES(pathPrefix + NS_LITERAL_CSTRING("type-objects/malloc-heap"),
                    zStats.typeObjectsMallocHeap,
                    "Memory holding miscellaneous additional information associated with type "
                    "objects.");
 
     ZCREPORT_BYTES(pathPrefix + NS_LITERAL_CSTRING("type-pool"),
                    zStats.typePool,
@@ -1971,22 +1971,23 @@ ReportCompartmentStats(const JS::Compart
                       "Memory on the garbage-collected JavaScript "
                       "heap that holds slow array objects.");
 
     ZCREPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects/gc-heap/cross-compartment-wrapper"),
                       cStats.objectsGCHeapCrossCompartmentWrapper,
                       "Memory on the garbage-collected JavaScript "
                       "heap that holds cross-compartment wrapper objects.");
 
-    ZCREPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("scripts/gc-heap"),
-                      cStats.scriptsGCHeap,
-                      "Memory on the garbage-collected JavaScript "
-                      "heap that holds JSScript instances. A JSScript is "
-                      "created for each user-defined function in a script. One "
-                      "is also created for the top-level code in a script.");
+    // Note that we use cDOMPathPrefix here.  This is because we measure orphan
+    // DOM nodes in the JS reporter, but we want to report them in a "dom"
+    // sub-tree rather than a "js" sub-tree.
+    ZCREPORT_BYTES(cDOMPathPrefix + NS_LITERAL_CSTRING("orphan-nodes"),
+                   cStats.objectsPrivate,
+                   "Memory used by orphan DOM nodes that are only reachable "
+                   "from JavaScript objects.");
 
     ZCREPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/gc-heap/tree/global-parented"),
                       cStats.shapesGCHeapTreeGlobalParented,
                       "Memory on the garbage-collected JavaScript heap that "
                       "holds shapes that (a) are in a property tree, and (b) "
                       "represent an object whose parent is the global object.");
 
     ZCREPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/gc-heap/tree/non-global-parented"),
@@ -2000,16 +2001,84 @@ ReportCompartmentStats(const JS::Compart
                       "Memory on the garbage-collected JavaScript "
                       "heap that holds shapes that are in dictionary mode.");
 
     ZCREPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/gc-heap/base"),
                       cStats.shapesGCHeapBase,
                       "Memory on the garbage-collected JavaScript "
                       "heap that collates data common to many shapes.");
 
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/tree-tables"),
+                   cStats.shapesMallocHeapTreeTables,
+                   "Memory allocated on the malloc heap for the property tables "
+                   "that belong to shapes that are in a property tree.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/dict-tables"),
+                   cStats.shapesMallocHeapDictTables,
+                   "Memory allocated on the malloc heap for the property tables "
+                   "that belong to shapes that are in dictionary mode.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/tree-shape-kids"),
+                   cStats.shapesMallocHeapTreeShapeKids,
+                   "Memory allocated on the malloc heap for the kid hashes that "
+                   "belong to shapes that are in a property tree.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/compartment-tables"),
+                   cStats.shapesMallocHeapCompartmentTables,
+                   "Memory on the malloc heap used by compartment-wide tables storing shape "
+                   "information for use during object construction.");
+
+    ZCREPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("scripts/gc-heap"),
+                      cStats.scriptsGCHeap,
+                      "Memory on the garbage-collected JavaScript "
+                      "heap that holds JSScript instances. A JSScript is "
+                      "created for each user-defined function in a script. One "
+                      "is also created for the top-level code in a script.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("scripts/malloc-heap/data"),
+                   cStats.scriptsMallocHeapData,
+                   "Memory on the malloc heap allocated for various variable-length tables in "
+                   "JSScript.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("baseline/data"),
+                   cStats.baselineData,
+                   "Memory used by the Baseline JIT for compilation data: "
+                   "BaselineScripts.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("baseline/stubs/fallback"),
+                   cStats.baselineStubsFallback,
+                   "Memory used by the Baseline JIT for fallback IC stubs "
+                   "(excluding code).");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("baseline/stubs/optimized"),
+                   cStats.baselineStubsOptimized,
+                   "Memory used by the Baseline JIT for optimized IC stubs "
+                   "(excluding code).");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("ion-data"),
+                   cStats.ionData,
+                   "Memory used by the IonMonkey JIT for compilation data: "
+                   "IonScripts.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("compartment-object"),
+                   cStats.compartmentObject,
+                   "Memory used for the JSCompartment object itself.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("cross-compartment-wrapper-table"),
+                   cStats.crossCompartmentWrappersTable,
+                   "Memory used by the cross-compartment wrapper table.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("regexp-compartment"),
+                   cStats.regexpCompartment,
+                   "Memory used by the regexp compartment.");
+
+    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("debuggees-set"),
+                   cStats.debuggeesSet,
+                   "Memory used by the debuggees set.");
+
     ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects/malloc-heap/slots"),
                    cStats.objectsExtra.mallocHeapSlots,
                    "Memory allocated on the malloc heap for the non-fixed object "
                    "slot arrays, which are used to represent object properties. "
                    "Some objects also contain a fixed number of slots which are "
                    "stored on the JavaScript heap; those slots "
                    "are not counted here, but in 'objects/gc-heap/*' instead.");
 
@@ -2058,85 +2127,16 @@ ReportCompartmentStats(const JS::Compart
     ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects/malloc-heap/property-iterator-data"),
                    cStats.objectsExtra.mallocHeapPropertyIteratorData,
                    "Memory allocated on the malloc heap for data belonging to property iterator objects.");
 
     ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects/malloc-heap/ctypes-data"),
                    cStats.objectsExtra.mallocHeapCtypesData,
                    "Memory allocated on the malloc heap for data belonging to ctypes objects.");
 
-    // Note that we use cDOMPathPrefix here.  This is because we measure orphan
-    // DOM nodes in the JS reporter, but we want to report them in a "dom"
-    // sub-tree rather than a "js" sub-tree.
-    ZCREPORT_BYTES(cDOMPathPrefix + NS_LITERAL_CSTRING("orphan-nodes"),
-                   cStats.objectsPrivate,
-                   "Memory used by orphan DOM nodes that are only reachable "
-                   "from JavaScript objects.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/tree-tables"),
-                   cStats.shapesMallocHeapTreeTables,
-                   "Memory allocated on the malloc heap for the property tables "
-                   "that belong to shapes that are in a property tree.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/dict-tables"),
-                   cStats.shapesMallocHeapDictTables,
-                   "Memory allocated on the malloc heap for the property tables "
-                   "that belong to shapes that are in dictionary mode.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/tree-shape-kids"),
-                   cStats.shapesMallocHeapTreeShapeKids,
-                   "Memory allocated on the malloc heap for the kid hashes that "
-                   "belong to shapes that are in a property tree.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes/malloc-heap/compartment-tables"),
-                   cStats.shapesMallocHeapCompartmentTables,
-                   "Memory on the malloc heap used by compartment-wide tables storing shape "
-                   "information for use during object construction.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("scripts/malloc-heap/data"),
-                   cStats.scriptsMallocHeapData,
-                   "Memory on the malloc heap allocated for various variable-length tables in "
-                   "JSScript.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("baseline/data"),
-                   cStats.baselineData,
-                   "Memory used by the Baseline JIT for compilation data: "
-                   "BaselineScripts.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("baseline/stubs/fallback"),
-                   cStats.baselineStubsFallback,
-                   "Memory used by the Baseline JIT for fallback IC stubs "
-                   "(excluding code).");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("baseline/stubs/optimized"),
-                   cStats.baselineStubsOptimized,
-                   "Memory used by the Baseline JIT for optimized IC stubs "
-                   "(excluding code).");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("ion-data"),
-                   cStats.ionData,
-                   "Memory used by the IonMonkey JIT for compilation data: "
-                   "IonScripts.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("compartment-object"),
-                   cStats.compartmentObject,
-                   "Memory used for the JSCompartment object itself.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("cross-compartment-wrapper-table"),
-                   cStats.crossCompartmentWrappersTable,
-                   "Memory used by the cross-compartment wrapper table.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("regexp-compartment"),
-                   cStats.regexpCompartment,
-                   "Memory used by the regexp compartment.");
-
-    ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("debuggees-set"),
-                   cStats.debuggeesSet,
-                   "Memory used by the debuggees set.");
-
     ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/type-scripts"),
                    cStats.typeInference.typeScripts,
                    "Memory used by type sets associated with scripts.");
 
     ZCREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/type-results"),
                    cStats.typeInference.typeResults,
                    "Memory used by dynamic type results produced by scripts.");
 
@@ -2229,38 +2229,16 @@ ReportJSRuntimeExplicitTreeStats(const J
                   "Memory used by DtoaState, which is used for converting "
                   "strings to numbers and vice versa.");
 
     RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/temporary"),
                   KIND_HEAP, rtStats.runtime.temporary,
                   "Memory held transiently in JSRuntime and used during "
                   "compilation.  It mostly holds parse nodes.");
 
-    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/ion"),
-                  KIND_NONHEAP, rtStats.runtime.code.ion,
-                  "Memory used by the IonMonkey JIT to hold generated code.");
-
-    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/baseline"),
-                  KIND_NONHEAP, rtStats.runtime.code.baseline,
-                  "Memory used by the Baseline JIT to hold generated code.");
-
-    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/regexp"),
-                  KIND_NONHEAP, rtStats.runtime.code.regexp,
-                  "Memory used by the regexp JIT to hold generated code.");
-
-    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/other"),
-                  KIND_NONHEAP, rtStats.runtime.code.other,
-                  "Memory used by the JITs to hold generated code for "
-                  "wrappers and trampolines.");
-
-    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/unused"),
-                  KIND_NONHEAP, rtStats.runtime.code.unused,
-                  "Memory allocated by one of the JITs to hold code, "
-                  "but which is currently unused.");
-
     RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/regexp-data"),
                   KIND_NONHEAP, rtStats.runtime.regexpData,
                   "Memory used by the regexp JIT to hold data.");
 
     RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/interpreter-stack"),
                   KIND_HEAP, rtStats.runtime.interpreterStack,
                   "Memory used for JS interpreter frames.");
 
@@ -2276,16 +2254,38 @@ ReportJSRuntimeExplicitTreeStats(const J
                   KIND_HEAP, rtStats.runtime.scriptData,
                   "Memory used for the table holding script data shared in "
                   "the runtime.");
 
     RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/script-sources"),
                   KIND_HEAP, rtStats.runtime.scriptSources,
                   "Memory use for storing JavaScript source code and filenames.");
 
+    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/ion"),
+                  KIND_NONHEAP, rtStats.runtime.code.ion,
+                  "Memory used by the IonMonkey JIT to hold generated code.");
+
+    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/baseline"),
+                  KIND_NONHEAP, rtStats.runtime.code.baseline,
+                  "Memory used by the Baseline JIT to hold generated code.");
+
+    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/regexp"),
+                  KIND_NONHEAP, rtStats.runtime.code.regexp,
+                  "Memory used by the regexp JIT to hold generated code.");
+
+    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/other"),
+                  KIND_NONHEAP, rtStats.runtime.code.other,
+                  "Memory used by the JITs to hold generated code for "
+                  "wrappers and trampolines.");
+
+    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/code/unused"),
+                  KIND_NONHEAP, rtStats.runtime.code.unused,
+                  "Memory allocated by one of the JITs to hold code, "
+                  "but which is currently unused.");
+
     if (rtTotalOut)
         *rtTotalOut = rtTotal;
 
     // Report GC numbers that don't belong to a compartment.
 
     // We don't want to report decommitted memory in "explicit", so we just
     // change the leading "explicit/" to "decommitted/".
     nsCString rtPath2(rtPath);