Bug 213345

Summary: Unify Bitmap math loops in MarkedBlock::Handle::specializedSweep().
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: JavaScriptCoreAssignee: Mark Lam <mark.lam>
Status: REOPENED ---    
Severity: Normal CC: benjamin, cdumez, cmarcelo, commit-queue, ews-watchlist, keith_miller, msaboff, rmorisset, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 215312    
Bug Blocks:    
Attachments:
Description Flags
proposed patch.
none
proposed patch.
saam: review+
patch for landing. none

Description Mark Lam 2020-06-18 11:40:23 PDT
Also address feedback from Robin and Saam in https://bugs.webkit.org/show_bug.cgi?id=213071.
Comment 1 Mark Lam 2020-06-18 12:10:40 PDT
Created attachment 402224 [details]
proposed patch.
Comment 2 Mark Lam 2020-06-18 12:19:08 PDT
Created attachment 402225 [details]
proposed patch.
Comment 3 Mark Lam 2020-06-18 12:27:05 PDT
Comment on attachment 402225 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=402225&action=review

> Source/JavaScriptCore/ChangeLog:11
> +        understand than then old code.

/then/the/

> Source/JavaScriptCore/ChangeLog:38
> +        5. Aldo fixed some typos in comments.

/Aldo/Also/
Comment 4 Robin Morisset 2020-06-18 12:41:15 PDT
Comment on attachment 402225 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=402225&action=review

r=me

> Source/JavaScriptCore/heap/MarkedBlockInlines.h:345
> +    if (emptyMode == NotEmpty) {

This section is *much* more readable than before, thanks!
Comment 5 Saam Barati 2020-06-18 12:47:04 PDT
Comment on attachment 402225 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=402225&action=review

> Source/JavaScriptCore/heap/MarkedBlockInlines.h:369
> +    // At this point, a set bit in freeAtoms represents live cells.

this is no longer true, right? Opposite
Comment 6 Saam Barati 2020-06-18 12:47:31 PDT
Comment on attachment 402225 [details]
proposed patch.

reinstating Robin's r+. I'm not done reviewing though
Comment 7 Saam Barati 2020-06-18 12:52:47 PDT
Comment on attachment 402225 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=402225&action=review

> Source/JavaScriptCore/heap/MarkedBlockInlines.h:367
> +    bool isEmpty = !anyBits;

alternatively, you can just set this to false, then to true when iterating freeAtoms.forEachSetBit below
Comment 8 Saam Barati 2020-06-18 12:55:03 PDT
Comment on attachment 402225 [details]
proposed patch.

r=me too
Comment 9 Mark Lam 2020-06-18 13:07:54 PDT
Comment on attachment 402225 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=402225&action=review

>> Source/JavaScriptCore/heap/MarkedBlockInlines.h:367
>> +    bool isEmpty = !anyBits;
> 
> alternatively, you can just set this to false, then to true when iterating freeAtoms.forEachSetBit below

Good point. Thanks.

>> Source/JavaScriptCore/heap/MarkedBlockInlines.h:369
>> +    // At this point, a set bit in freeAtoms represents live cells.
> 
> this is no longer true, right? Opposite

Will fix.
Comment 10 Mark Lam 2020-06-18 19:14:17 PDT
Created attachment 402261 [details]
patch for landing.
Comment 11 Mark Lam 2020-06-18 20:31:20 PDT
Thanks for the reviews.  Landed in r263252: <http://trac.webkit.org/r263252>.
Comment 12 Radar WebKit Bug Importer 2020-06-18 20:32:17 PDT
<rdar://problem/64516410>
Comment 13 WebKit Commit Bot 2020-08-09 02:07:01 PDT
Re-opened since this is blocked by bug 215312