Sweeping happens at an awkward time during collection due to the fact that destructors can cause arbitrary reentry into the VM. If we were to delay sweeping until after collection was completely finished then we would no longer have this problem.
Created attachment 220488 [details] Patch
Comment on attachment 220488 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=220488&action=review r=me > Source/JavaScriptCore/heap/Heap.cpp:734 > + SamplingRegion samplingRegion("Garbage Collection: Sweeping"); Sampling region should probably go before DelayedReleaseScope, so we sample all destructor time, including delayed destructor time.
Committed r161429: <http://trac.webkit.org/changeset/161429>