bug 939049 - staticly type nsIDocument::mDocumentContainer and nsDocumentViewerContainer::mContainer r=smaug
bug 939049 - get rid of useless QIs r=smaug
Bug 935721, part 1 - Store the listener pointer on the nsCycleCollector data structure. r=smaug

With ICC, the listener must persist across invocations of the CC, so store it on the CC.
Bug 935721, part 2 - Allocate GCGraphBuilder on the heap. r=smaug

With ICC, the graph builder must persist across invocations of the CC,
so store it on the heap.
Bug 935721, part 3 - Use RAII to set mScanInProgress, hoist out MarkRoots and ScanRoots. r=smaug

With ICC, mScanInProgress gets set and cleared a bunch of times so add an RAII class to turn
it on when we're doing stuff and clear it when we're not.

With that in place, we can easily move MarkRoots and ScanRoots out of BeginCollection
in preparation for making them separate phases in ICC.
Bug 935721, part 4 - Allocate white nodes array in CollectWhite. r=smaug

The white nodes array is only used in CollectWhite, so just allocate it there.
Bug 935721, part 5 - Invert the control flow of CycleCollectNow's pre- and post-collection work, add CCResults as a field on the CC. r=smaug

nsJSEnvironment::CycleCollectNow does work before and after a CC runs. With ICC, nsJSEnv won't
know where in the CC when a CC is about to begin or end, so this patch reorganizes that work
into two separate callback hooks.  This requires adding a new struct, CycleCollectorStats, to
hold data nsJSEnv needs between the two calls.

Rather than trying to pass around a pointer to a results structure, this patch just adds
it to the nsCycleCollector struct, and always stores them. The results are passed back
to the end CC callback.
Bug 935721, part 6 - Replace ccResults with aResults in EndCycleCollectionCallback. r=smaug

This is done in a separate patch to reduce the size of the previous patch a bit.
Bug 935721, part 7 - Inline PrepareForCollection into BeginCollection. r=smaug

PrepareForCollection is trivial now, so just inline it.
Bug 935721, part 8 - Add a reference to the graph to the graph builder. r=smaug

This moves towards letting the CC graph outlive the builder.
Bug 935721, part 9 - Move mPtrToNodeMap into GCGraph. r=smaug

With ICC, we may have to remove things from the graph after we have finished building
the graph, so move the mapping to graph addresses into the graph itself to create a
more self-contained structure.
Bug 935721, part 10 - Separate nsCycleCollector_collect and nsCycleCollector_scheduledCollect. r=smaug