author | Andrew McCreight <continuation@gmail.com> |
Tue, 10 Sep 2013 08:56:35 -0700 | |
changeset 146437 | 50f93200b17607796f95476e4e251310335af888 |
parent 146436 | 431aa2871160c2498b0d6ee6bb84f74e5eb5aaa0 |
child 146438 | 8ac551efe4e110a439212a70002807fa1b7e9bac |
push id | 25260 |
push user | ryanvm@gmail.com |
push date | Wed, 11 Sep 2013 00:29:30 +0000 |
treeherder | mozilla-central@f73bed2856a8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug |
bugs | 913881 |
milestone | 26.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
|
--- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -929,84 +929,79 @@ private: nsCOMPtr<nsIMemoryMultiReporter> mReporter; nsPurpleBuffer mPurpleBuf; uint32_t mUnmergedNeeded; uint32_t mMergedInARow; public: + nsCycleCollector(); + ~nsCycleCollector(); + void RegisterJSRuntime(CycleCollectedJSRuntime *aJSRuntime); void ForgetJSRuntime(); void SetBeforeUnlinkCallback(CC_BeforeUnlinkCallback aBeforeUnlinkCB) { CheckThreadSafety(); mBeforeUnlinkCB = aBeforeUnlinkCB; } void SetForgetSkippableCallback(CC_ForgetSkippableCallback aForgetSkippableCB) { CheckThreadSafety(); mForgetSkippableCB = aForgetSkippableCB; } - void MarkRoots(GCGraphBuilder &aBuilder); - void ScanRoots(); - void ScanWeakMaps(); - - void ForgetSkippable(bool aRemoveChildlessNodes, bool aAsyncSnowWhiteFreeing); - - // returns whether anything was collected - bool CollectWhite(nsICycleCollectorListener *aListener); - - nsCycleCollector(); - ~nsCycleCollector(); - void Suspect(void *n, nsCycleCollectionParticipant *cp, nsCycleCollectingAutoRefCnt *aRefCnt); - - void CheckThreadSafety(); - -private: - void ShutdownCollect(nsICycleCollectorListener *aListener); - -public: + uint32_t SuspectedCount(); + void ForgetSkippable(bool aRemoveChildlessNodes, bool aAsyncSnowWhiteFreeing); + bool FreeSnowWhite(bool aUntilNoSWInPurpleBuffer); + bool Collect(ccType aCCType, nsTArray<PtrInfo*> *aWhiteNodes, nsCycleCollectorResults *aResults, nsICycleCollectorListener *aListener); + void Shutdown(); + + void SizeOfIncludingThis(MallocSizeOf aMallocSizeOf, + size_t *aObjectSize, + size_t *aGraphNodesSize, + size_t *aGraphEdgesSize, + size_t *aWhiteNodeSize, + size_t *aPurpleBufferSize) const; + +private: + void CheckThreadSafety(); + void ShutdownCollect(nsICycleCollectorListener *aListener); void PrepareForCollection(nsCycleCollectorResults *aResults, nsTArray<PtrInfo*> *aWhiteNodes); void FixGrayBits(bool aForceGC); bool ShouldMergeZones(ccType aCCType); - void CleanupAfterCollection(); void BeginCollection(ccType aCCType, nsICycleCollectorListener *aListener); - - bool FreeSnowWhite(bool aUntilNoSWInPurpleBuffer); - - uint32_t SuspectedCount(); - void Shutdown(); + void MarkRoots(GCGraphBuilder &aBuilder); + void ScanRoots(); + void ScanWeakMaps(); + + // returns whether anything was collected + bool CollectWhite(nsICycleCollectorListener *aListener); + + void CleanupAfterCollection(); void ClearGraph() { mGraph.mNodes.Clear(); mGraph.mEdges.Clear(); mGraph.mWeakMaps.Clear(); mGraph.mRootCount = 0; } - - void SizeOfIncludingThis(MallocSizeOf aMallocSizeOf, - size_t *aObjectSize, - size_t *aGraphNodesSize, - size_t *aGraphEdgesSize, - size_t *aWhiteNodeSize, - size_t *aPurpleBufferSize) const; }; /** * GraphWalker is templatized over a Visitor class that must provide * the following two methods: * * bool ShouldVisitNode(PtrInfo const *pi); * void VisitNode(PtrInfo *pi);