Bug 1311227 - Annotate ffi_call as a GC function, r=jonco
authorSteve Fink <sfink@mozilla.com>
Wed, 19 Oct 2016 11:24:48 -0700
changeset 327162 7ab404ffffc6b813dc7491cf076c8c40e91abbec
parent 327161 4e9f3f0d6d8e2c7e8aa0037decd8405d5024bfa0
child 327163 5ff2c66f4020dbe9f77d5fe5187f9316ca7605df
push id85120
push usersfink@mozilla.com
push dateFri, 23 Dec 2016 19:54:47 +0000
treeherdermozilla-inbound@7ab404ffffc6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjonco
bugs1311227
milestone53.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 1311227 - Annotate ffi_call as a GC function, r=jonco
js/src/devtools/rootAnalysis/annotations.js
js/src/devtools/rootAnalysis/loadCallgraph.js
--- a/js/src/devtools/rootAnalysis/annotations.js
+++ b/js/src/devtools/rootAnalysis/annotations.js
@@ -223,16 +223,20 @@ var ignoreFunctions = {
     "EntryType* nsTHashtable<EntryType>::PutEntry(nsTHashtable<EntryType>::KeyType) [with EntryType = nsBaseHashtableET<nsPtrHashKey<const mozilla::BlockingResourceBase>, nsAutoPtr<mozilla::DeadlockDetector<mozilla::BlockingResourceBase>::OrderingEntry> >; nsTHashtable<EntryType>::KeyType = const mozilla::BlockingResourceBase*]" : true,
     "EntryType* nsTHashtable<EntryType>::GetEntry(nsTHashtable<EntryType>::KeyType) const [with EntryType = nsBaseHashtableET<nsPtrHashKey<const mozilla::BlockingResourceBase>, nsAutoPtr<mozilla::DeadlockDetector<mozilla::BlockingResourceBase>::OrderingEntry> >; nsTHashtable<EntryType>::KeyType = const mozilla::BlockingResourceBase*]" : true,
 
     // The big hammers.
     "PR_GetCurrentThread" : true,
     "calloc" : true,
 };
 
+function extraGCFunctions() {
+    return ["ffi_call"];
+}
+
 function isProtobuf(name)
 {
     return name.match(/\bgoogle::protobuf\b/) ||
            name.match(/\bmozilla::devtools::protobuf\b/);
 }
 
 function isHeapSnapshotMockClass(name)
 {
--- a/js/src/devtools/rootAnalysis/loadCallgraph.js
+++ b/js/src/devtools/rootAnalysis/loadCallgraph.js
@@ -121,16 +121,21 @@ function loadCallgraph(file)
             var tag = match[2];
             if (tag == 'GC Call') {
                 addGCFunction(mangled, "GC");
                 numGCCalls++;
             }
         }
     }
 
+    // Add in any extra functions at the end. (If we did this early, it would
+    // mess up the id <-> name correspondence.)
+    for (var func of extraGCFunctions())
+        addGCFunction(func, "annotation");
+
     // Initialize suppressedFunctions to the set of all functions, and the
     // worklist to all toplevel callers.
     var worklist = [];
     for (var callee in callerGraph)
         suppressedFunctions[callee] = true;
     for (var caller in calleeGraph) {
         if (!(caller in callerGraph)) {
             suppressedFunctions[caller] = true;