Bug 126556

Summary: Heap::collect shouldn't be responsible for sweeping
Product: WebKit Reporter: Mark Hahnenberg <mhahnenberg>
Component: JavaScriptCoreAssignee: Mark Hahnenberg <mhahnenberg>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ggaren: review+

Description Mark Hahnenberg 2014-01-06 17:30:32 PST
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.
Comment 1 Mark Hahnenberg 2014-01-06 20:53:57 PST
Created attachment 220488 [details]
Patch
Comment 2 Geoffrey Garen 2014-01-06 21:32:00 PST
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.
Comment 3 Mark Hahnenberg 2014-01-07 09:36:02 PST
Committed r161429: <http://trac.webkit.org/changeset/161429>