Bug 756260 - Fix up building without JS_HAS_XML_SUPPORT, again. r=terrence.
authorJason Orendorff <jorendorff@mozilla.com>
Thu, 17 May 2012 16:24:32 -0500
changeset 98327 a93a94ce41bae29ed250dc1878b649557bd1001f
parent 98326 12020cb10acedf8e7f1ed80f4141cf4b7d64fe9d
child 98328 648093316d93c4649cdee91c43a94aef661aaf77
push idunknown
push userunknown
push dateunknown
reviewersterrence
bugs756260
milestone15.0a1
Bug 756260 - Fix up building without JS_HAS_XML_SUPPORT, again. r=terrence.
js/public/MemoryMetrics.h
js/src/MemoryMetrics.cpp
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -118,17 +118,19 @@ struct CompartmentStats
     size_t gcHeapObjectsNonFunction;
     size_t gcHeapObjectsFunction;
     size_t gcHeapStrings;
     size_t gcHeapShapesTree;
     size_t gcHeapShapesDict;
     size_t gcHeapShapesBase;
     size_t gcHeapScripts;
     size_t gcHeapTypeObjects;
+#if JS_HAS_XML_SUPPORT
     size_t gcHeapXML;
+#endif
 
     size_t objectSlots;
     size_t objectElements;
     size_t objectMisc;
     size_t stringChars;
     size_t shapesExtraTreeTables;
     size_t shapesExtraDictTables;
     size_t shapesExtraTreeShapeKids;
--- a/js/src/MemoryMetrics.cpp
+++ b/js/src/MemoryMetrics.cpp
@@ -164,21 +164,23 @@ StatsCellCallback(JSRuntime *rt, void *d
     }
     case JSTRACE_TYPE_OBJECT:
     {
         types::TypeObject *obj = static_cast<types::TypeObject *>(thing);
         cStats->gcHeapTypeObjects += thingSize;
         obj->sizeOfExcludingThis(&cStats->typeInferenceSizes, rtStats->mallocSizeOf);
         break;
     }
+#if JS_HAS_XML_SUPPORT
     case JSTRACE_XML:
     {
         cStats->gcHeapXML += thingSize;
         break;
     }
+#endif
     }
     // Yes, this is a subtraction:  see StatsArenaCallback() for details.
     cStats->gcHeapArenaUnused -= thingSize;
 }
 
 JS_PUBLIC_API(bool)
 CollectRuntimeStats(JSRuntime *rt, RuntimeStats *rtStats)
 {
@@ -218,18 +220,20 @@ CollectRuntimeStats(JSRuntime *rt, Runti
                       cStats.gcHeapArenaUnused +
                       cStats.gcHeapObjectsNonFunction +
                       cStats.gcHeapObjectsFunction +
                       cStats.gcHeapStrings +
                       cStats.gcHeapShapesTree +
                       cStats.gcHeapShapesDict +
                       cStats.gcHeapShapesBase +
                       cStats.gcHeapScripts +
-                      cStats.gcHeapTypeObjects +
-                      cStats.gcHeapXML;
+#if JS_HAS_XML_SUPPORT
+                      cStats.gcHeapXML +
+#endif
+                      cStats.gcHeapTypeObjects;
 
         rtStats->gcHeapChunkDirtyUnused -= used;
         rtStats->gcHeapArenaUnused += cStats.gcHeapArenaUnused;
         rtStats->totalObjects += cStats.gcHeapObjectsNonFunction +
                                  cStats.gcHeapObjectsFunction +
                                  cStats.objectSlots +
                                  cStats.objectElements +
                                  cStats.objectMisc;
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -1418,20 +1418,22 @@ ReportCompartmentStats(const JS::Compart
                      "Memory on the compartment's garbage-collected JavaScript "
                      "heap that collates data common to many shapes.");
 
     REPORT_GC_BYTES0(MakePath(pathPrefix, cStats, "gc-heap/type-objects"),
                      cStats.gcHeapTypeObjects,
                      "Memory on the compartment's garbage-collected JavaScript "
                      "heap that holds type inference information.");
 
+#if JS_HAS_XML_SUPPORT
     REPORT_GC_BYTES0(MakePath(pathPrefix, cStats, "gc-heap/xml"),
                      cStats.gcHeapXML,
                      "Memory on the compartment's garbage-collected JavaScript "
                      "heap that holds E4X XML objects.");
+#endif
 
     REPORT_BYTES0(MakePath(pathPrefix, cStats, "objects/slots"),
                   nsIMemoryReporter::KIND_HEAP, cStats.objectSlots,
                   "Memory allocated for the compartment's 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 compartment's JavaScript heap; those slots "
                   "are not counted here, but in 'gc-heap/objects' instead.");