Bug 168257

Summary: Add JSC_sweepSynchronously and fix JSC_useZombieMode options.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: fpizlo, ggaren, jfbastien, keith_miller, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch.
msaboff: review+
proposed patch with fixes.
saam: review+
proposed patch. fpizlo: review+

Mark Lam
Reported 2017-02-13 14:55:10 PST
Patch coming.
Attachments
proposed patch. (4.35 KB, patch)
2017-02-13 15:00 PST, Mark Lam
msaboff: review+
proposed patch with fixes. (5.10 KB, patch)
2017-02-13 17:43 PST, Mark Lam
saam: review+
proposed patch. (7.73 KB, patch)
2017-02-14 11:10 PST, Mark Lam
fpizlo: review+
Mark Lam
Comment 1 2017-02-13 14:56:43 PST
Mark Lam
Comment 2 2017-02-13 15:00:41 PST
Created attachment 301396 [details] proposed patch. Let's get some EWS testing on this.
Mark Lam
Comment 3 2017-02-13 16:59:34 PST
Comment on attachment 301396 [details] proposed patch. Looks ready for a review.
Michael Saboff
Comment 4 2017-02-13 17:14:09 PST
Comment on attachment 301396 [details] proposed patch. r=me
Mark Lam
Comment 5 2017-02-13 17:28:04 PST
Comment on attachment 301396 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=301396&action=review > Source/JavaScriptCore/heap/Heap.cpp:1060 > + sweepSynchronously(); > + if (Options::useZombieMode()) > + zombifyDeadObjects(); Turns out this is not needed because collectSync() above will take care of invoking sweepSynchronously() and zombifyDeadObjects() if needed. I'll also add some GC logging when zombifying. Updated patch coming soon.
Mark Lam
Comment 6 2017-02-13 17:32:42 PST
Comment on attachment 301396 [details] proposed patch. View in context: https://bugs.webkit.org/attachment.cgi?id=301396&action=review >> Source/JavaScriptCore/heap/Heap.cpp:1060 >> + zombifyDeadObjects(); > > Turns out this is not needed because collectSync() above will take care of invoking sweepSynchronously() and zombifyDeadObjects() if needed. I'll also add some GC logging when zombifying. Updated patch coming soon. Correction: sweepSyncronously is still needed if neither Options::sweepSynchronously() or Options::useZombieMode() are set because collectSync() does not sweep synchronously by default. Will fix.
Mark Lam
Comment 7 2017-02-13 17:43:35 PST
Created attachment 301428 [details] proposed patch with fixes.
Saam Barati
Comment 8 2017-02-13 17:48:13 PST
Comment on attachment 301428 [details] proposed patch with fixes. View in context: https://bugs.webkit.org/attachment.cgi?id=301428&action=review LGTM > Source/JavaScriptCore/heap/Heap.cpp:1043 > + dataLog("=> ", capacity() / 1024, "kb, ", after - before, "ms] "); Why not put the "\n" here? > Source/JavaScriptCore/heap/Heap.cpp:1980 > + dataLog("=> ", capacity() / 1024, "kb, ", after - before, "ms] "); ditto
Mark Lam
Comment 9 2017-02-13 17:55:56 PST
Comment on attachment 301428 [details] proposed patch with fixes. View in context: https://bugs.webkit.org/attachment.cgi?id=301428&action=review Thanks for the review. >> Source/JavaScriptCore/heap/Heap.cpp:1043 >> + dataLog("=> ", capacity() / 1024, "kb, ", after - before, "ms] "); > > Why not put the "\n" here? Because this function may be called from Heap::finalize() which has its own logging which wraps this line. Putting a '\n' here will premature terminate the "[GC: finalize ...]" logging in Heap::finalize(). >> Source/JavaScriptCore/heap/Heap.cpp:1980 >> + dataLog("=> ", capacity() / 1024, "kb, ", after - before, "ms] "); > > ditto Same as above.
Mark Lam
Comment 10 2017-02-14 11:10:16 PST
Created attachment 301526 [details] proposed patch. One more time: this time, re-define useZombieMode as the combination of sweepSynchronously + scribbleFreeCells.
Mark Lam
Comment 11 2017-02-14 11:15:28 PST
Thanks for the reviews. Landed in r212310: <http://trac.webkit.org/r212310>.
Note You need to log in before you can comment on or make changes to this bug.