Closed Bug 1973654 Opened 4 days ago Closed 2 days ago

Refactor the buffer allocator in preparation for arbitrarily sized small buffers

Categories

(Core :: JavaScript: GC, task, P1)

task

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(8 files)

The patch stack for bug 1973033 got too large so I'm splitting out a bunch of refactoring work into this bug.

Assignee: nobody → jcoppeard
Severity: -- → N/A
Priority: -- → P1

We're using the mark bitmap in the buffer allocator but we don't use most of
the methods. Simplify things by splitting out a separate class AtomicBitmap and
use that instead.

We can them remove the templates from MarkBitmap and use this directly in
chunks.

Not related to the buffer allocator, but I noticed that getOrAllocChunk has
only a single caller. This patch combines the two methods.

Also this renames the 'emplace' method to the simpler 'init'.

This commons up some assertions and simplifies the bitmap and array accessors.

This can be simplified by marking it work in terms of bit index rather than
converting back and forth from byte offsets all the time.

Pushed by jcoppeard@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5d4999e82db8 https://hg.mozilla.org/integration/autoland/rev/20280fc54582 Part 1: Split out AtomicBitmap and simplify MarkBitmap r=sfink https://github.com/mozilla-firefox/firefox/commit/3196aeb106cb https://hg.mozilla.org/integration/autoland/rev/7b84a0ec0400 Part 2: Remove unnecessary takeOrAllocChunk and rename emplace to init r=sfink https://github.com/mozilla-firefox/firefox/commit/8165915de6f8 https://hg.mozilla.org/integration/autoland/rev/4c89ad2d94ed Part 3: Refactor BufferAllocator::addFreeRegion to move the size class calculation inside r=sfink https://github.com/mozilla-firefox/firefox/commit/40a5d5dabd3f https://hg.mozilla.org/integration/autoland/rev/56b737163e0e Part 4: Combine BufferAllocator::allocSmall and allocSmallInGC r=sfink https://github.com/mozilla-firefox/firefox/commit/a7e158f917ff https://hg.mozilla.org/integration/autoland/rev/8e568a61e5ab Part 5: Move findFollowing/PreviousFreeRegion methods to BufferChunk r=sfink https://github.com/mozilla-firefox/firefox/commit/4d962aa9aad7 https://hg.mozilla.org/integration/autoland/rev/4f85cf27c6cd Part 6: Refactor bitmap/array operations on BufferChunk r=sfink https://github.com/mozilla-firefox/firefox/commit/675353147ee6 https://hg.mozilla.org/integration/autoland/rev/8687dfc6943d Part 7: Replace use of min size with granularity where appropriate r=sfink https://github.com/mozilla-firefox/firefox/commit/d76a5621f42e https://hg.mozilla.org/integration/autoland/rev/a38aa536aa36 Part 8: Make BufferChunkIter an inner class of BufferChunk and simplify it r=sfink https://github.com/mozilla-firefox/firefox/commit/ee5adb5fe585 https://hg.mozilla.org/integration/autoland/rev/386a713dc309 apply code formatting via Lando
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: