Bug 798510 - Part 2: Fix bug in JSRuntime::sizeOfExplicitNonHeap() where, if execAlloc_ is null, we don't measure the stack space. rs=njn
authorJustin Lebar <justin.lebar@gmail.com>
Thu, 11 Oct 2012 18:55:53 -0400
changeset 109982 cea04d0eb7c92ba837d401c3092d4ef9f9143ce2
parent 109981 05567a9159c5ef3abea6dc57915bf7b296c5965a
child 109983 9f28c28e988f2de9f11c89f1c04c13b5fa86fe90
push id16315
push userjlebar@mozilla.com
push dateThu, 11 Oct 2012 22:56:20 +0000
treeherdermozilla-inbound@cea04d0eb7c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs798510
milestone19.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 798510 - Part 2: Fix bug in JSRuntime::sizeOfExplicitNonHeap() where, if execAlloc_ is null, we don't measure the stack space. rs=njn
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -134,22 +134,25 @@ JSRuntime::sizeOfIncludingThis(JSMallocS
     rtSizes->scriptFilenames = scriptFilenameTable.sizeOfExcludingThis(mallocSizeOf);
     for (ScriptFilenameTable::Range r = scriptFilenameTable.all(); !r.empty(); r.popFront())
         rtSizes->scriptFilenames += mallocSizeOf(r.front());
 }
 
 size_t
 JSRuntime::sizeOfExplicitNonHeap()
 {
-    if (!execAlloc_)
-        return 0;
+    size_t size = stackSpace.sizeOf();
 
-    size_t jaegerCode, ionCode, regexpCode, unusedCode;
-    execAlloc_->sizeOfCode(&jaegerCode, &ionCode, &regexpCode, &unusedCode);
-    return jaegerCode + ionCode + regexpCode + unusedCode + stackSpace.sizeOf();
+    if (execAlloc_) {
+        size_t jaegerCode, ionCode, regexpCode, unusedCode;
+        execAlloc_->sizeOfCode(&jaegerCode, &ionCode, &regexpCode, &unusedCode);
+        size += jaegerCode + ionCode + regexpCode + unusedCode;
+    }
+
+    return size;
 }
 
 void
 JSRuntime::triggerOperationCallback()
 {
     /*
      * Invalidate ionTop to trigger its over-recursion check. Note this must be
      * set before interrupt, to avoid racing with js_InvokeOperationCallback,