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 130738 8a16d529df16e35dec10b9368d60561051a36bb9
parent 130736 1998eb59e36988949ad9bcb4c8ddfa21c7e4dd65
child 130739 eb04c9a69ac912cd0511ca79cf98fd0f805cf6a0
push id1579
push userphilringnalda@gmail.com
push dateSat, 04 May 2013 04:38:04 +0000
treeherderfx-team@a56432a42a41 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs868037
milestone23.0a1
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)
 {