Bug 1169791 - Strongly type MergeZone; r=mccr8
authorTerrence Cole <terrence@mozilla.com>
Mon, 01 Jun 2015 14:11:06 -0700
changeset 269374 4585e00e51409a893738b3f2ee002620a224e905
parent 269373 1777d85c79fe792425e9f340deba8396253bffc0
child 269375 dc3f0e384651be79b0be54f207861f9170b66b5d
push id2501
push userjosea.olivera@gmail.com
push dateWed, 03 Jun 2015 06:55:32 +0000
reviewersmccr8
bugs1169791
milestone41.0a1
Bug 1169791 - Strongly type MergeZone; r=mccr8
xpcom/base/nsCycleCollector.cpp
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2111,22 +2111,22 @@ private:
     }
     mEdgeBuilder.Add(childPi);
     if (mListener) {
       mListener->NoteEdge((uint64_t)aChild, aEdgeName.get());
     }
     ++childPi->mInternalRefs;
   }
 
-  JS::Zone* MergeZone(void* aGcthing)
+  JS::Zone* MergeZone(JS::GCCellPtr aGcthing)
   {
     if (!mMergeZones) {
       return nullptr;
     }
-    JS::Zone* zone = JS::GetTenuredGCThingZone(aGcthing);
+    JS::Zone* zone = JS::GetTenuredGCThingZone(aGcthing.asCell());
     if (js::IsSystemZone(zone)) {
       return nullptr;
     }
     return zone;
   }
 };
 
 CCGraphBuilder::CCGraphBuilder(CCGraph& aGraph,
@@ -2270,17 +2270,17 @@ CCGraphBuilder::NoteXPCOMRoot(nsISupport
   ToParticipant(aRoot, &cp);
 
   NoteRoot(aRoot, cp);
 }
 
 NS_IMETHODIMP_(void)
 CCGraphBuilder::NoteJSRoot(JSObject* aRoot)
 {
-  if (JS::Zone* zone = MergeZone(aRoot)) {
+  if (JS::Zone* zone = MergeZone(JS::GCCellPtr(aRoot))) {
     NoteRoot(zone, mJSZoneParticipant);
   } else {
     NoteRoot(aRoot, mJSParticipant);
   }
 }
 
 NS_IMETHODIMP_(void)
 CCGraphBuilder::NoteNativeRoot(void* aRoot,
@@ -2379,17 +2379,17 @@ CCGraphBuilder::NoteJSChild(JS::GCCellPt
 
   nsCString edgeName;
   if (MOZ_UNLIKELY(WantDebugInfo())) {
     edgeName.Assign(mNextEdgeName);
     mNextEdgeName.Truncate();
   }
 
   if (GCThingIsGrayCCThing(aChild) || MOZ_UNLIKELY(WantAllTraces())) {
-    if (JS::Zone* zone = MergeZone(aChild.asCell())) {
+    if (JS::Zone* zone = MergeZone(aChild)) {
       NoteChild(zone, mJSZoneParticipant, edgeName);
     } else {
       NoteChild(aChild.asCell(), mJSParticipant, edgeName);
     }
   }
 }
 
 NS_IMETHODIMP_(void)
@@ -2404,17 +2404,17 @@ PtrInfo*
 CCGraphBuilder::AddWeakMapNode(JS::GCCellPtr aNode)
 {
   MOZ_ASSERT(aNode, "Weak map node should be non-null.");
 
   if (!GCThingIsGrayCCThing(aNode) && !WantAllTraces()) {
     return nullptr;
   }
 
-  if (JS::Zone* zone = MergeZone(aNode.asCell())) {
+  if (JS::Zone* zone = MergeZone(aNode)) {
     return AddNode(zone, mJSZoneParticipant);
   }
   return AddNode(aNode.asCell(), mJSParticipant);
 }
 
 PtrInfo*
 CCGraphBuilder::AddWeakMapNode(JSObject* aObject)
 {