Bug 1400435 - Remove special case from analysis. r=sfink
authorBobby Holley <bobbyholley@gmail.com>
Tue, 19 Sep 2017 14:58:20 -0700
changeset 381821 94f70af939b5b8bb32ad9102f9a7073a2b198db6
parent 381820 e5bd13138738491c93fe3b1351f670b7202050c3
child 381822 0735f44b742a1d2bfb00310df2115e27f3e4d0b7
push id32537
push userarchaeopteryx@coole-files.de
push dateWed, 20 Sep 2017 09:39:24 +0000
treeherdermozilla-central@c0769d228dd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1400435
milestone57.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 1400435 - Remove special case from analysis. r=sfink MozReview-Commit-ID: LdX4k3hDysU
js/src/devtools/rootAnalysis/analyzeHeapWrites.js
--- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
+++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
@@ -26,16 +26,17 @@ function checkExternalFunction(entry)
         "floor",
         "ceil",
         "atof",
         /memchr/,
         "strlen",
         "Servo_ComputedValues_EqualCustomProperties",
         /Servo_DeclarationBlock_GetCssText/,
         "Servo_GetArcStringData",
+        "Servo_IsWorkerThread",
         /nsIFrame::AppendOwnedAnonBoxes/,
         // Assume that atomic accesses are threadsafe.
         /^__atomic_fetch_/,
         /^__atomic_load_/,
         /^__atomic_store_/,
         /^__atomic_thread_fence/,
     ];
     if (entry.matches(whitelist))
@@ -299,23 +300,16 @@ function checkFieldWrite(entry, location
         if (/\bThreadLocal<\b/.test(field))
             return;
     }
 
     var str = "";
     for (var field of fields)
         str += " " + field;
 
-    // Bug 1400435
-    if (entry.stack[entry.stack.length - 1].callee.match(/^Gecko_CSSValue_Set/) &&
-        str == " nsAutoRefCnt.mValue")
-    {
-        return;
-    }
-
     dumpError(entry, location, "Field write" + str);
 }
 
 function checkDereferenceWrite(entry, location, variable)
 {
     var name = entry.name;
 
     // Maybe<T> uses placement new on local storage in a way we don't understand.
@@ -1085,20 +1079,16 @@ function maybeProcessMissingFunction(ent
 function processRoot(name)
 {
     var safeArguments = [];
     var parameterNames = {};
     var worklist = [new WorklistEntry(name, safeArguments, [new CallSite(name, safeArguments, null, parameterNames)], parameterNames)];
 
     reachable = {};
 
-    var armed = false;
-    if (name.includes("Gecko_CSSValue_Set"))
-        armed = true;
-
     while (worklist.length > 0) {
         var entry = worklist.pop();
 
         // In principle we would be better off doing a meet-over-paths here to get
         // the common subset of arguments which are safe to write through. However,
         // analyzing functions separately for each subset if simpler, ensures that
         // the stack traces we produce accurately characterize the stack arguments,
         // and should be fast enough for now.
@@ -1364,16 +1354,18 @@ function testFailsOffMainThread(exp, val
     switch (exp.Kind) {
       case "Drf":
         var edge = expressionValueEdge(exp.Exp[0]);
         if (edge) {
             if (isDirectCall(edge, /NS_IsMainThread/) && value)
                 return true;
             if (isDirectCall(edge, /IsInServoTraversal/) && !value)
                 return true;
+            if (isDirectCall(edge, /IsCurrentThreadInServoTraversal/) && !value)
+                return true;
             if (isDirectCall(edge, /__builtin_expect/))
                 return testFailsOffMainThread(edge.PEdgeCallArguments.Exp[0], value);
             if (edge.Kind == "Assign")
                 return testFailsOffMainThread(edge.Exp[1], value);
         }
         break;
       case "Unop":
         if (exp.OpCode == "LogicalNot")