Summary: | [bmalloc] Remove code duplication from small bump ranges. | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Basuke Suzuki <Basuke.Suzuki> | ||||||||||
Component: | bmalloc | Assignee: | Basuke Suzuki <Basuke.Suzuki> | ||||||||||
Status: | ASSIGNED --- | ||||||||||||
Severity: | Normal | CC: | Basuke.Suzuki, ggaren, webkit-bug-importer, ysuzuki | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Attachments: |
|
Description
Basuke Suzuki
2020-09-01 15:37:14 PDT
Created attachment 407860 [details]
PATCH
Created attachment 407861 [details]
PATCH
Created attachment 407890 [details]
Fix debug build
Created attachment 407916 [details]
Refactoring
Comment on attachment 407916 [details] Refactoring View in context: https://bugs.webkit.org/attachment.cgi?id=407916&action=review Can you run MallocBench to ensure that this does not affect on the performance? Because this code is super critical path in bmalloc. > Source/bmalloc/bmalloc/Heap.cpp:372 > +inline void allocateSmallBumpRangesInline( Let's put BINLINE since this is super critical path which we should ensure that this is always inlined regardless of compiler's decision. > Source/bmalloc/bmalloc/Heap.cpp:385 > + lineCache[page->sizeClass()].push(page); Let's pass sizeClass and use it. > Source/bmalloc/bmalloc/Heap.cpp:403 > + auto sizeClass = page->sizeClass(); Let's use passed sizeClass. > Source/bmalloc/bmalloc/Heap.h:172 > + allocateSmallBumpRangesByMetadata(lock, page, allocator, rangeCache, lineCache); > + else > + allocateSmallBumpRangesByObject(lock, page, allocator, rangeCache, lineCache); Let's just pass `sizeClass` too. |