Bug 814229 (part 2) - Refactor storage of the "objects-extra" numbers.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 21 Nov 2012 17:07:42 -0800
changeset 125693 9b58f6e07b21822830b68c993510761322813e97
parent 125692 f3fc7f4f20a08c3323fc07f8f9055639fa4c8886
child 125694 cd7f3548011c7a66a958ee7e3f174532dd33ee11
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs814229
milestone20.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 814229 (part 2) - Refactor storage of the "objects-extra" numbers.
js/public/MemoryMetrics.h
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsmemorymetrics.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -29,41 +29,55 @@ namespace js {
 // We need to define this value here, rather than in the code which actually
 // generates the memory reports, because HugeStringInfo uses this value.
 JS_FRIEND_API(size_t) MemoryReportingSundriesThreshold();
 
 } // namespace js
 
 namespace JS {
 
+// Data for tracking memory usage of things hanging off objects.
+struct ObjectsExtraSizes {
+    size_t slots;
+    size_t elements;
+    size_t argumentsData;
+    size_t regExpStatics;
+    size_t propertyIteratorData;
+    size_t ctypesData;
+    size_t private_;    // The '_' suffix is required because |private| is a keyword.
+                        // Note that this field is measured separately from the others.
+
+    ObjectsExtraSizes() { memset(this, 0, sizeof(ObjectsExtraSizes)); }
+
+    void add(ObjectsExtraSizes &sizes) {
+        this->slots                += sizes.slots;
+        this->elements             += sizes.elements;
+        this->argumentsData        += sizes.argumentsData;
+        this->regExpStatics        += sizes.regExpStatics;
+        this->propertyIteratorData += sizes.propertyIteratorData;
+        this->ctypesData           += sizes.ctypesData;
+        this->private_             += sizes.private_;
+    }
+};
+
 // Data for tracking analysis/inference memory usage.
 struct TypeInferenceSizes
 {
-    TypeInferenceSizes()
-      : typeScripts(0)
-      , typeResults(0)
-      , analysisPool(0)
-      , typePool(0)
-      , pendingArrays(0)
-      , allocationSiteTables(0)
-      , arrayTypeTables(0)
-      , objectTypeTables(0)
-      , typeObjects(0)
-    {}
-
     size_t typeScripts;
     size_t typeResults;
     size_t analysisPool;
     size_t typePool;
     size_t pendingArrays;
     size_t allocationSiteTables;
     size_t arrayTypeTables;
     size_t objectTypeTables;
     size_t typeObjects;
 
+    TypeInferenceSizes() { memset(this, 0, sizeof(TypeInferenceSizes)); }
+
     void add(TypeInferenceSizes &sizes) {
         this->typeScripts          += sizes.typeScripts;
         this->typeResults          += sizes.typeResults;
         this->analysisPool         += sizes.analysisPool;
         this->typePool             += sizes.typePool;
         this->pendingArrays        += sizes.pendingArrays;
         this->allocationSiteTables += sizes.allocationSiteTables;
         this->arrayTypeTables      += sizes.arrayTypeTables;
@@ -156,35 +170,31 @@ struct CompartmentStats
       , gcHeapShapesDict(0)
       , gcHeapShapesBase(0)
       , gcHeapScripts(0)
       , gcHeapTypeObjects(0)
       , gcHeapIonCodes(0)
 #if JS_HAS_XML_SUPPORT
       , gcHeapXML(0)
 #endif
-      , objectsExtraSlots(0)
-      , objectsExtraElements(0)
-      , objectsExtraArgumentsData(0)
-      , objectsExtraRegExpStatics(0)
-      , objectsExtraPropertyIteratorData(0)
-      , objectsExtraCtypesData(0)
-      , objectsExtraPrivate(0)
+      , objectsExtra()
       , stringCharsNonHuge(0)
       , shapesExtraTreeTables(0)
       , shapesExtraDictTables(0)
       , shapesExtraTreeShapeKids(0)
       , shapesCompartmentTables(0)
       , scriptData(0)
       , jaegerData(0)
       , ionData(0)
       , compartmentObject(0)
       , crossCompartmentWrappersTable(0)
       , regexpCompartment(0)
       , debuggeesSet(0)
+      , typeInference()
+      , hugeStrings()
     {}
 
     CompartmentStats(const CompartmentStats &other)
       : extra1(other.extra1)
       , extra2(other.extra2)
       , gcHeapArenaAdmin(other.gcHeapArenaAdmin)
       , gcHeapUnusedGcThings(other.gcHeapUnusedGcThings)
       , gcHeapObjectsOrdinary(other.gcHeapObjectsOrdinary)
@@ -199,36 +209,30 @@ struct CompartmentStats
       , gcHeapShapesDict(other.gcHeapShapesDict)
       , gcHeapShapesBase(other.gcHeapShapesBase)
       , gcHeapScripts(other.gcHeapScripts)
       , gcHeapTypeObjects(other.gcHeapTypeObjects)
       , gcHeapIonCodes(other.gcHeapIonCodes)
 #if JS_HAS_XML_SUPPORT
       , gcHeapXML(other.gcHeapXML)
 #endif
-      , objectsExtraSlots(other.objectsExtraSlots)
-      , objectsExtraElements(other.objectsExtraElements)
-      , objectsExtraArgumentsData(other.objectsExtraArgumentsData)
-      , objectsExtraRegExpStatics(other.objectsExtraRegExpStatics)
-      , objectsExtraPropertyIteratorData(other.objectsExtraPropertyIteratorData)
-      , objectsExtraCtypesData(other.objectsExtraCtypesData)
-      , objectsExtraPrivate(other.objectsExtraPrivate)
+      , objectsExtra(other.objectsExtra)
       , stringCharsNonHuge(other.stringCharsNonHuge)
       , shapesExtraTreeTables(other.shapesExtraTreeTables)
       , shapesExtraDictTables(other.shapesExtraDictTables)
       , shapesExtraTreeShapeKids(other.shapesExtraTreeShapeKids)
       , shapesCompartmentTables(other.shapesCompartmentTables)
       , scriptData(other.scriptData)
       , jaegerData(other.jaegerData)
       , ionData(other.ionData)
       , compartmentObject(other.compartmentObject)
       , crossCompartmentWrappersTable(other.crossCompartmentWrappersTable)
       , regexpCompartment(other.regexpCompartment)
       , debuggeesSet(other.debuggeesSet)
-      , typeInferenceSizes(other.typeInferenceSizes)
+      , typeInference(other.typeInference)
     {
       hugeStrings.append(other.hugeStrings);
     }
 
     // These fields can be used by embedders.
     void   *extra1;
     void   *extra2;
 
@@ -249,38 +253,32 @@ struct CompartmentStats
     size_t gcHeapShapesDict;
     size_t gcHeapShapesBase;
     size_t gcHeapScripts;
     size_t gcHeapTypeObjects;
     size_t gcHeapIonCodes;
 #if JS_HAS_XML_SUPPORT
     size_t gcHeapXML;
 #endif
+    ObjectsExtraSizes objectsExtra;
 
-    size_t objectsExtraSlots;
-    size_t objectsExtraElements;
-    size_t objectsExtraArgumentsData;
-    size_t objectsExtraRegExpStatics;
-    size_t objectsExtraPropertyIteratorData;
-    size_t objectsExtraCtypesData;
-    size_t objectsExtraPrivate;
     size_t stringCharsNonHuge;
     size_t shapesExtraTreeTables;
     size_t shapesExtraDictTables;
     size_t shapesExtraTreeShapeKids;
     size_t shapesCompartmentTables;
     size_t scriptData;
     size_t jaegerData;
     size_t ionData;
     size_t compartmentObject;
     size_t crossCompartmentWrappersTable;
     size_t regexpCompartment;
     size_t debuggeesSet;
 
-    TypeInferenceSizes typeInferenceSizes;
+    TypeInferenceSizes typeInference;
     js::Vector<HugeStringInfo, 0, js::SystemAllocPolicy> hugeStrings;
 
     // Add cStats's numbers to this object's numbers.
     void add(CompartmentStats &cStats)
     {
         #define ADD(x)  this->x += cStats.x
 
         ADD(gcHeapArenaAdmin);
@@ -298,40 +296,34 @@ struct CompartmentStats
         ADD(gcHeapShapesDict);
         ADD(gcHeapShapesBase);
         ADD(gcHeapScripts);
         ADD(gcHeapTypeObjects);
         ADD(gcHeapIonCodes);
     #if JS_HAS_XML_SUPPORT
         ADD(gcHeapXML);
     #endif
+        objectsExtra.add(cStats.objectsExtra);
 
-        ADD(objectsExtraSlots);
-        ADD(objectsExtraElements);
-        ADD(objectsExtraArgumentsData);
-        ADD(objectsExtraRegExpStatics);
-        ADD(objectsExtraPropertyIteratorData);
-        ADD(objectsExtraCtypesData);
-        ADD(objectsExtraPrivate);
         ADD(stringCharsNonHuge);
         ADD(shapesExtraTreeTables);
         ADD(shapesExtraDictTables);
         ADD(shapesExtraTreeShapeKids);
         ADD(shapesCompartmentTables);
         ADD(scriptData);
         ADD(jaegerData);
         ADD(ionData);
         ADD(compartmentObject);
         ADD(crossCompartmentWrappersTable);
         ADD(regexpCompartment);
         ADD(debuggeesSet);
 
         #undef ADD
 
-        typeInferenceSizes.add(cStats.typeInferenceSizes);
+        typeInference.add(cStats.typeInference);
         hugeStrings.append(cStats.hugeStrings);
     }
 
     // The size of all the live things in the GC heap.
     size_t gcHeapThingsSize();
 };
 
 struct RuntimeStats
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -6542,23 +6542,23 @@ JSCompartment::sizeOfTypeInferenceData(T
             const ObjectTableEntry &value = e.front().value;
 
             /* key.ids and values.types have the same length. */
             sizes->objectTypeTables += mallocSizeOf(key.ids) + mallocSizeOf(value.types);
         }
     }
 }
 
-void
-TypeObject::sizeOfExcludingThis(TypeInferenceSizes *sizes, JSMallocSizeOfFun mallocSizeOf)
+size_t
+TypeObject::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf)
 {
     if (singleton) {
         /*
          * Properties and associated type sets for singletons are cleared on
          * every GC. The type object is normally destroyed too, but we don't
          * charge this to 'temporary' as this is not for GC heap values.
          */
         JS_ASSERT(!newScript);
-        return;
-    }
-
-    sizes->typeObjects += mallocSizeOf(newScript);
-}
+        return 0;
+    }
+
+    return mallocSizeOf(newScript);
+}
--- a/js/src/jsinfer.h
+++ b/js/src/jsinfer.h
@@ -17,20 +17,16 @@
 #include "ds/LifoAlloc.h"
 #include "gc/Barrier.h"
 #include "gc/Heap.h"
 #include "js/HashTable.h"
 #include "js/Vector.h"
 
 ForwardDeclareJS(Script);
 
-namespace JS {
-struct TypeInferenceSizes;
-}
-
 namespace js {
 
 class TaggedProto
 {
   public:
     TaggedProto() : proto(NULL) {}
     TaggedProto(JSObject *proto) : proto(proto) {}
 
@@ -1031,17 +1027,17 @@ struct TypeObject : gc::Cell
     void clearNewScript(JSContext *cx);
     void getFromPrototypes(JSContext *cx, jsid id, TypeSet *types, bool force = false);
 
     void print();
 
     inline void clearProperties();
     inline void sweep(FreeOp *fop);
 
-    void sizeOfExcludingThis(TypeInferenceSizes *sizes, JSMallocSizeOfFun mallocSizeOf);
+    size_t sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf);
 
     /*
      * Type objects don't have explicit finalizers. Memory owned by a type
      * object pending deletion is released when weak references are sweeped
      * from all the compartment's type objects.
      */
     void finalize(FreeOp *fop) {}
 
--- a/js/src/jsmemorymetrics.cpp
+++ b/js/src/jsmemorymetrics.cpp
@@ -89,17 +89,17 @@ StatsCompartmentCallback(JSRuntime *rt, 
     MOZ_ALWAYS_TRUE(rtStats->compartmentStatsVector.growBy(1));
     CompartmentStats &cStats = rtStats->compartmentStatsVector.back();
     rtStats->initExtraCompartmentStats(compartment, &cStats);
     rtStats->currCompartmentStats = &cStats;
 
     // Measure the compartment object itself, and things hanging off it.
     compartment->sizeOfIncludingThis(rtStats->mallocSizeOf,
                                      &cStats.compartmentObject,
-                                     &cStats.typeInferenceSizes,
+                                     &cStats.typeInference,
                                      &cStats.shapesCompartmentTables,
                                      &cStats.crossCompartmentWrappersTable,
                                      &cStats.regexpCompartment,
                                      &cStats.debuggeesSet);
 }
 
 static void
 StatsChunkCallback(JSRuntime *rt, void *data, gc::Chunk *chunk)
@@ -146,34 +146,29 @@ StatsCellCallback(JSRuntime *rt, void *d
             cStats->gcHeapObjectsDenseArray += thingSize;
         } else if (obj->isSlowArray()) {
             cStats->gcHeapObjectsSlowArray += thingSize;
         } else if (obj->isCrossCompartmentWrapper()) {
             cStats->gcHeapObjectsCrossCompartmentWrapper += thingSize;
         } else {
             cStats->gcHeapObjectsOrdinary += thingSize;
         }
-        size_t slotsSize, elementsSize, argumentsDataSize, regExpStaticsSize,
-               propertyIteratorDataSize, ctypesDataSize;
-        obj->sizeOfExcludingThis(rtStats->mallocSizeOf, &slotsSize, &elementsSize,
-                                 &argumentsDataSize, &regExpStaticsSize,
-                                 &propertyIteratorDataSize, &ctypesDataSize);
-        cStats->objectsExtraSlots += slotsSize;
-        cStats->objectsExtraElements += elementsSize;
-        cStats->objectsExtraArgumentsData += argumentsDataSize;
-        cStats->objectsExtraRegExpStatics += regExpStaticsSize;
-        cStats->objectsExtraPropertyIteratorData += propertyIteratorDataSize;
-        cStats->objectsExtraCtypesData += ctypesDataSize;
 
+        ObjectsExtraSizes objectsExtra;
+        obj->sizeOfExcludingThis(rtStats->mallocSizeOf, &objectsExtra);
+        cStats->objectsExtra.add(objectsExtra);
+
+        // JSObject::sizeOfExcludingThis() doesn't measure objectsExtraPrivate,
+        // so we do it here.
         if (ObjectPrivateVisitor *opv = closure->opv) {
             js::Class *clazz = js::GetObjectClass(obj);
             if (clazz->flags & JSCLASS_HAS_PRIVATE &&
                 clazz->flags & JSCLASS_PRIVATE_IS_NSISUPPORTS)
             {
-                cStats->objectsExtraPrivate += opv->sizeOfIncludingThis(GetObjectPrivate(obj));
+                cStats->objectsExtra.private_ += opv->sizeOfIncludingThis(GetObjectPrivate(obj));
             }
         }
         break;
     }
     case JSTRACE_STRING:
     {
         JSString *str = static_cast<JSString *>(thing);
 
@@ -250,17 +245,17 @@ StatsCellCallback(JSRuntime *rt, void *d
 # endif
 #endif
         break;
     }
     case JSTRACE_TYPE_OBJECT:
     {
         types::TypeObject *obj = static_cast<types::TypeObject *>(thing);
         cStats->gcHeapTypeObjects += thingSize;
-        obj->sizeOfExcludingThis(&cStats->typeInferenceSizes, rtStats->mallocSizeOf);
+        cStats->typeInference.typeObjects += obj->sizeOfExcludingThis(rtStats->mallocSizeOf);
         break;
     }
 #if JS_HAS_XML_SUPPORT
     case JSTRACE_XML:
     {
         cStats->gcHeapXML += thingSize;
         break;
     }
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -23,16 +23,20 @@
 #include "jsinfer.h"
 
 #include "gc/Barrier.h"
 #include "gc/Heap.h"
 
 #include "vm/ObjectImpl.h"
 #include "vm/String.h"
 
+namespace JS {
+struct ObjectsExtraSizes;
+}
+
 namespace js {
 
 class AutoPropDescArrayRooter;
 class BaseProxyHandler;
 class CallObject;
 struct GCMarker;
 struct NativeIterator;
 ForwardDeclare(Shape);
@@ -363,21 +367,17 @@ struct JSObject : public js::ObjectImpl
     inline bool isIndexed() const;
 
     inline uint32_t propertyCount() const;
 
     inline bool hasShapeTable() const;
 
     inline size_t computedSizeOfThisSlotsElements() const;
 
-    inline void sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *slotsSize,
-                                    size_t *elementsSize, size_t *argumentsDataSize,
-                                    size_t *regExpStaticsSize,
-                                    size_t *propertyIteratorDataSize,
-                                    size_t *ctypesDataSize) const;
+    inline void sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, JS::ObjectsExtraSizes *sizes);
 
     bool hasIdempotentProtoChain() const;
 
     static const uint32_t MAX_FIXED_SLOTS = 16;
 
   public:
 
     /* Accessors for properties. */
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -26,16 +26,17 @@
 #include "jsxml.h"
 #include "jswrapper.h"
 
 #include "builtin/MapObject.h"
 #include "builtin/Iterator-inl.h"
 #include "gc/Barrier.h"
 #include "gc/Marking.h"
 #include "gc/Root.h"
+#include "js/MemoryMetrics.h"
 #include "js/TemplateLib.h"
 #include "vm/BooleanObject.h"
 #include "vm/GlobalObject.h"
 #include "vm/NumberObject.h"
 #include "vm/RegExpStatics.h"
 #include "vm/StringObject.h"
 
 #include "jsatominlines.h"
@@ -994,45 +995,35 @@ JSObject::computedSizeOfThisSlotsElement
     if (hasDynamicElements())
         n += (js::ObjectElements::VALUES_PER_HEADER + getElementsHeader()->capacity) *
              sizeof(js::Value);
 
     return n;
 }
 
 inline void
-JSObject::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, size_t *slotsSize,
-                              size_t *elementsSize, size_t *argumentsDataSize,
-                              size_t *regExpStaticsSize, size_t *propertyIteratorDataSize,
-                              size_t *ctypesDataSize) const
+JSObject::sizeOfExcludingThis(JSMallocSizeOfFun mallocSizeOf, JS::ObjectsExtraSizes *sizes)
 {
-    *slotsSize = 0;
-    if (hasDynamicSlots()) {
-        *slotsSize += mallocSizeOf(slots);
-    }
+    if (hasDynamicSlots())
+        sizes->slots = mallocSizeOf(slots);
+
+    if (hasDynamicElements())
+        sizes->elements = mallocSizeOf(getElementsHeader());
 
-    *elementsSize = 0;
-    if (hasDynamicElements()) {
-        *elementsSize += mallocSizeOf(getElementsHeader());
-    }
-
-    /* Other things may be measured in the future if DMD indicates it is worthwhile. */
-    *argumentsDataSize = 0;
-    *regExpStaticsSize = 0;
-    *propertyIteratorDataSize = 0;
-    *ctypesDataSize = 0;
+    // Other things may be measured in the future if DMD indicates it is worthwhile.
+    // Note that sizes->private_ is measured elsewhere.
     if (isArguments()) {
-        *argumentsDataSize += asArguments().sizeOfMisc(mallocSizeOf);
+        sizes->argumentsData = asArguments().sizeOfMisc(mallocSizeOf);
     } else if (isRegExpStatics()) {
-        *regExpStaticsSize += js::SizeOfRegExpStaticsData(this, mallocSizeOf);
+        sizes->regExpStatics = js::SizeOfRegExpStaticsData(this, mallocSizeOf);
     } else if (isPropertyIterator()) {
-        *propertyIteratorDataSize += asPropertyIterator().sizeOfMisc(mallocSizeOf);
+        sizes->propertyIteratorData = asPropertyIterator().sizeOfMisc(mallocSizeOf);
     } else {
         // This must be the last case.
-        *ctypesDataSize += js::SizeOfDataIfCDataObject(mallocSizeOf, const_cast<JSObject *>(this));
+        sizes->ctypesData = js::SizeOfDataIfCDataObject(mallocSizeOf, const_cast<JSObject *>(this));
     }
 }
 
 /* static */ inline JSBool
 JSObject::lookupGeneric(JSContext *cx, js::HandleObject obj, js::HandleId id,
                         js::MutableHandleObject objp, js::MutableHandleShape propp)
 {
     js::LookupGenericOp op = obj->getOps()->lookupGeneric;
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -1592,50 +1592,50 @@ ReportCompartmentStats(const JS::Compart
 #if JS_HAS_XML_SUPPORT
     CREPORT_GC_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("gc-heap/xml"),
                      cStats.gcHeapXML,
                      "Memory on the garbage-collected JavaScript "
                      "heap that holds E4X XML objects.");
 #endif
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects-extra/slots"),
-                  cStats.objectsExtraSlots,
+                  cStats.objectsExtra.slots,
                   "Memory allocated 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 'gc-heap/objects' instead.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects-extra/elements"),
-                  cStats.objectsExtraElements,
+                  cStats.objectsExtra.elements,
                   "Memory allocated for object element "
                   "arrays, which are used to represent indexed object "
                   "properties.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects-extra/arguments-data"),
-                  cStats.objectsExtraArgumentsData,
+                  cStats.objectsExtra.argumentsData,
                   "Memory allocated for data belonging to arguments objects.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects-extra/regexp-statics"),
-                  cStats.objectsExtraRegExpStatics,
+                  cStats.objectsExtra.regExpStatics,
                   "Memory allocated for data belonging to the RegExpStatics object.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects-extra/property-iterator-data"),
-                  cStats.objectsExtraPropertyIteratorData,
+                  cStats.objectsExtra.propertyIteratorData,
                   "Memory allocated for data belonging to property iterator objects.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("objects-extra/ctypes-data"),
-                  cStats.objectsExtraCtypesData,
+                  cStats.objectsExtra.ctypesData,
                   "Memory allocated for data belonging to ctypes objects.");
- 
+
     // Note that we use cDOMPathPrefix here.  This is because we measure orphan
     // DOM nodes in the JS multi-reporter, but we want to report them in a
     // "dom" sub-tree rather than a "js" sub-tree.
     CREPORT_BYTES(cDOMPathPrefix + NS_LITERAL_CSTRING("orphan-nodes"),
-                  cStats.objectsExtraPrivate,
+                  cStats.objectsExtra.private_,
                   "Memory used by orphan DOM nodes that are only reachable "
                   "from JavaScript objects.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("shapes-extra/tree-tables"),
                   cStats.shapesExtraTreeTables,
                   "Memory allocated for the property tables "
                   "that belong to shapes that are in a property tree.");
 
@@ -1681,50 +1681,50 @@ ReportCompartmentStats(const JS::Compart
                   cStats.regexpCompartment,
                   "Memory used by the regexp compartment.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("debuggees-set"),
                   cStats.debuggeesSet,
                   "Memory used by the debuggees set.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/type-scripts"),
-                  cStats.typeInferenceSizes.typeScripts,
+                  cStats.typeInference.typeScripts,
                   "Memory used by type sets associated with scripts.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/type-results"),
-                  cStats.typeInferenceSizes.typeResults,
+                  cStats.typeInference.typeResults,
                   "Memory used by dynamic type results produced by scripts.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/analysis-pool"),
-                  cStats.typeInferenceSizes.analysisPool,
+                  cStats.typeInference.analysisPool,
                   "Memory holding transient analysis information used during type inference and "
                   "compilation.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/type-pool"),
-                  cStats.typeInferenceSizes.typePool,
+                  cStats.typeInference.typePool,
                   "Memory holding contents of type sets and related data.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/pending-arrays"),
-                  cStats.typeInferenceSizes.pendingArrays,
+                  cStats.typeInference.pendingArrays,
                   "Memory used for solving constraints during type inference.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/allocation-site-tables"),
-                  cStats.typeInferenceSizes.allocationSiteTables,
+                  cStats.typeInference.allocationSiteTables,
                   "Memory indexing type objects associated with allocation sites.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/array-type-tables"),
-                  cStats.typeInferenceSizes.arrayTypeTables,
+                  cStats.typeInference.arrayTypeTables,
                   "Memory indexing type objects associated with array literals.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/object-type-tables"),
-                  cStats.typeInferenceSizes.objectTypeTables,
+                  cStats.typeInference.objectTypeTables,
                   "Memory indexing type objects associated with object literals.");
 
     CREPORT_BYTES(cJSPathPrefix + NS_LITERAL_CSTRING("type-inference/type-objects"),
-                  cStats.typeInferenceSizes.typeObjects,
+                  cStats.typeInference.typeObjects,
                   "Memory holding miscellaneous additional information associated with type "
                   "objects.");
 
     CREPORT_BYTES2(cJSPathPrefix + NS_LITERAL_CSTRING("string-chars/non-huge"),
                    cStats.stringCharsNonHuge, nsPrintfCString(
                    "Memory allocated to hold characters of strings whose "
                    "characters take up less than than %d bytes of memory.\n\n"
                    "Sometimes more memory is allocated than necessary, to "