Bug 180315
Summary: | forEachLiveCell should be safe in the case of concurrent aboutToMarkSlow() without grabbing a lock for each call to isLive | ||
---|---|---|---|
Product: | WebKit | Reporter: | Filip Pizlo <fpizlo> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 165909 |
Filip Pizlo
...
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Filip Pizlo
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.