Bug 1400442 - analyzeHeapWrites: getter_Copies preserves safety (similar to getter_AddRefs), r=bhackett
authorSteve Fink <sfink@mozilla.com>
Fri, 08 Sep 2017 15:03:06 -0700
changeset 433650 4ff3e372de3d54aadf62d9ad97eae7cd9a6dafd9
parent 433649 3835877e5870ac4f4034fc8d97f8284d59519091
child 433651 8fe39aef352a049563f1444d5e1798b383d7d716
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1400442
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 1400442 - analyzeHeapWrites: getter_Copies preserves safety (similar to getter_AddRefs), r=bhackett
js/src/devtools/rootAnalysis/analyzeHeapWrites.js
--- a/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
+++ b/js/src/devtools/rootAnalysis/analyzeHeapWrites.js
@@ -1187,21 +1187,21 @@ function isSafeLocalVariable(entry, name
             // itself is threadsafe.
             if ((isDirectCall(edge, /operator\[\]/) ||
                  isDirectCall(edge, /nsStyleContent::ContentAt/)) &&
                 isEdgeSafeArgument(entry, edge.PEdgeCallInstance.Exp))
             {
                 return true;
             }
 
-            // Watch for the coerced result of a getter_AddRefs call.
+            // Watch for the coerced result of a getter_AddRefs or getter_Copies call.
             if (isDirectCall(edge, /operator /)) {
                 var otherEdge = expressionValueEdge(edge.PEdgeCallInstance.Exp);
                 if (otherEdge &&
-                    isDirectCall(otherEdge, /getter_AddRefs/) &&
+                    isDirectCall(otherEdge, /getter_(?:AddRefs|Copies)/) &&
                     isEdgeSafeArgument(entry, otherEdge.PEdgeCallArguments.Exp[0]))
                 {
                     return true;
                 }
             }
 
             // RefPtr::operator->() and operator* transmit the safety of the
             // RefPtr to the return value.