Bug 254960
| Summary: | Use fixed-size deadCells vector in MarkedBlock::sweep | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Degazio <d_degazio> |
| Component: | JavaScriptCore | Assignee: | David Degazio <d_degazio> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
David Degazio
rdar://107585451
In MarkedBlock::specializedSweep, we allocate a `Vector<uint64_t>` to store the list of dead cells we need to destroy. However, the maximum number of atoms in a MarkedBlock is bounded by a constant - currently 1024. This means we can do two things:
- Because the maximum atom number is less than 65536, we can store them as `uint16_t`s to reduce memory usage/improve locality.
- At only 1024 atoms per block, and since `specializedSweep` isn't recursive or anything, it's probably fine to allocate the full storage of the vector on the stack. This means we avoid allocation (both initially and to grow the vector), can use `Vector::uncheckedAppend`, and probably improve locality somewhat.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
David Degazio
Pull request: https://github.com/WebKit/WebKit/pull/12350
EWS
Committed 262612@main (424d1996eedf): <https://commits.webkit.org/262612@main>
Reviewed commits have been landed. Closing PR #12350 and removing active labels.