Bug 868037 - GC: Fix more rooting analysis false positives r=sfink DONTBUILD
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 03 May 2013 13:32:04 +0100
changeset 141673 8a16d529df16e35dec10b9368d60561051a36bb9
parent 141671 1998eb59e36988949ad9bcb4c8ddfa21c7e4dd65
child 141674 eb04c9a69ac912cd0511ca79cf98fd0f805cf6a0
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs868037
milestone23.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 868037 - GC: Fix more rooting analysis false positives r=sfink DONTBUILD
js/src/devtools/rootAnalysis/annotations.js
js/src/devtools/rootAnalysis/computeGCTypes.js
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -23,16 +23,23 @@ function indirectCallCannotGC(caller, na
 
     if (name == "params" && caller == "PR_ExplodeTime")
         return true;
 
     // hook called during script finalization which cannot GC.
     if (/CallDestroyScriptHook/.test(caller))
         return true;
 
+    // template method called during marking and hence cannot GC
+    if (name == "op" &&
+        /^bool js::WeakMap<Key, Value, HashPolicy>::keyNeedsMark\(JSObject\*\)/.test(caller))
+    {
+        return true;
+    }
+
     return false;
 }
 
 // Ignore calls through functions pointers with these types
 var ignoreClasses = {
     "JSTracer" : true,
     "JSStringFinalizer" : true,
     "SprintfStateStr" : true,
--- a/js/src/devtools/rootAnalysis/computeGCTypes.js
+++ b/js/src/devtools/rootAnalysis/computeGCTypes.js
@@ -14,17 +14,17 @@ function processCSU(csu, body)
         if (type.Kind == "Pointer") {
             var target = type.Type;
             if (target.Kind == "CSU")
                 addNestedPointer(csu, target.Name);
         }
         if (type.Kind == "CSU") {
             // Ignore nesting in classes which are AutoGCRooters. We only consider
             // types with fields that may not be properly rooted.
-            if (type.Name == "JS::AutoGCRooter")
+            if (type.Name == "JS::AutoGCRooter" || type.Name == "JS::CustomAutoRooter")
                 return;
             addNestedStructure(csu, type.Name);
         }
     }
 }
 
 function addNestedStructure(csu, inner)
 {