Bug 961883 (part 3) - Measure and report the Nursery. r=terrence.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 21 Jan 2014 17:17:08 -0800
changeset 181065 ab28001660645bc628dd388968c0564a256710f9
parent 181064 ff7db0b58713c1996558fdbee461ad73bf60666e
child 181066 8be30d3b0b8037c66a1ff1ca0a70cf43cad229e0
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs961883
milestone29.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 961883 (part 3) - Measure and report the Nursery. r=terrence.
js/public/MemoryMetrics.h
js/src/gc/Nursery.h
js/src/vm/Runtime.cpp
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/public/MemoryMetrics.h
+++ b/js/public/MemoryMetrics.h
@@ -209,16 +209,17 @@ struct CodeSizes
 #undef FOR_EACH_SIZE
 };
 
 // Data for tracking GC memory usage.
 struct GCSizes
 {
 #define FOR_EACH_SIZE(macro) \
     macro(_, _, marker) \
+    macro(_, _, nursery) \
     macro(_, _, storeBufferVals) \
     macro(_, _, storeBufferCells) \
     macro(_, _, storeBufferSlots) \
     macro(_, _, storeBufferWholeCells) \
     macro(_, _, storeBufferRelocVals) \
     macro(_, _, storeBufferRelocCells) \
     macro(_, _, storeBufferGenerics)
 
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -118,16 +118,18 @@ class Nursery
      * returns false and leaves |*ref| unset.
      */
     template <typename T>
     JS_ALWAYS_INLINE bool getForwardedPointer(T **ref);
 
     /* Forward a slots/elements pointer stored in an Ion frame. */
     void forwardBufferPointer(HeapSlot **pSlotsElems);
 
+    size_t sizeOfHeap() { return start() ? NurserySize : 0; }
+
 #ifdef JS_GC_ZEAL
     /*
      * In debug and zeal builds, these bytes indicate the state of an unused
      * segment of nursery-allocated memory.
      */
     static const uint8_t FreshNursery = 0x2a;
     static const uint8_t SweptNursery = 0x2b;
     static const uint8_t AllocatedThing = 0x2c;
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -619,16 +619,17 @@ JSRuntime::addSizeOfIncludingThis(mozill
             if (JSC::ExecutableAllocator *ionAlloc = jitRuntime()->ionAlloc(this))
                 ionAlloc->addSizeOfCode(&rtSizes->code);
         }
     }
 #endif
 
     rtSizes->gc.marker += gcMarker.sizeOfExcludingThis(mallocSizeOf);
 #ifdef JSGC_GENERATIONAL
+    rtSizes->gc.nursery += gcNursery.sizeOfHeap();
     gcStoreBuffer.addSizeOfExcludingThis(mallocSizeOf, &rtSizes->gc);
 #endif
 }
 
 static bool
 SignalBasedTriggersDisabled()
 {
   // Don't bother trying to cache the getenv lookup; this should be called
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2303,16 +2303,20 @@ ReportJSRuntimeExplicitTreeStats(const J
                   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/gc/marker"),
                   KIND_HEAP, rtStats.runtime.gc.marker,
                   "Memory used for the GC mark stack and gray roots.");
 
+    RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/gc/nursery"),
+                  KIND_NONHEAP, rtStats.runtime.gc.nursery,
+                  "Memory used for the GC nursery.");
+
     RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/gc/store-buffer/vals"),
                   KIND_HEAP, rtStats.runtime.gc.storeBufferVals,
                   "Memory used for values in the store buffer.");
 
     RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/gc/store-buffer/cells"),
                   KIND_HEAP, rtStats.runtime.gc.storeBufferCells,
                   "Memory used for cells in the store buffer.");