Bug 126556 - Heap::collect shouldn't be responsible for sweeping
Summary: Heap::collect shouldn't be responsible for sweeping
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-06 17:30 PST by Mark Hahnenberg
Modified: 2014-01-07 09:36 PST (History)
2 users (show)

See Also:


Attachments
Patch (4.36 KB, patch)
2014-01-06 20:53 PST, Mark Hahnenberg
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>