Bug 180315 - forEachLiveCell should be safe in the case of concurrent aboutToMarkSlow() without grabbing a lock for each call to isLive
Summary: forEachLiveCell should be safe in the case of concurrent aboutToMarkSlow() wi...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 165909
  Show dependency treegraph
 
Reported: 2017-12-02 11:20 PST by Filip Pizlo
Modified: 2017-12-02 11:58 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2017-12-02 11:20:10 PST
...
Comment 1 Filip Pizlo 2017-12-02 11:58:34 PST
It just occurred to me that the algorithm for forEachLiveCell could be:

- If the block is allocated, just walk all objects.

- If the block has newly allocated at the outset, then walk that.  I think that grabbing the lock at the beginning just to verify that newly allocated is set up is sufficient.

- Otherwise, walk the mark bits, and recheck the state of the block at the end.  If the block is still in the mark bits state, then we're done.  If it's not, then rewalk it.