Bug 39758 - Heap::allocate should search a word at a time
Summary: Heap::allocate should search a word at a time
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nathan Lawrence
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-26 12:59 PDT by Nathan Lawrence
Modified: 2010-05-27 14:45 PDT (History)
4 users (show)

See Also:


Attachments
suggested patch (748 bytes, patch)
2010-05-26 13:00 PDT, Nathan Lawrence
ggaren: review-
Details | Formatted Diff | Diff
Moved the advance logic from Heap::allocate to CollectorBitmap::advanceToNextPossibleFreeCell. (2.12 KB, patch)
2010-05-26 14:04 PDT, Nathan Lawrence
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Lawrence 2010-05-26 12:59:00 PDT
Currently, Heap::allocate is searching for a new cell in the bitmap a single bit at a time.  This can be improved by searching a word at a time in the bitmap when our first guess fails.
Comment 1 Nathan Lawrence 2010-05-26 13:00:03 PDT
Created attachment 57126 [details]
suggested patch
Comment 2 Geoffrey Garen 2010-05-26 13:10:20 PDT
Comment on attachment 57126 [details]
suggested patch

+            if (!~block->marked.bits[m_heap.nextCell >> 5])
+                m_heap.nextCell = (m_heap.nextCell & (~0x1F)) + 32;

I think this code might be wrong on 64bit.

Also, would be nice to encapsulate these bitops in the CollectorBitmap interface.

Let's talk about this in person.
Comment 3 Nathan Lawrence 2010-05-26 14:04:56 PDT
Created attachment 57132 [details]
Moved the advance logic from Heap::allocate to CollectorBitmap::advanceToNextPossibleFreeCell.

Hey, I uploaded the patch to the correct bug this time!
Comment 4 Geoffrey Garen 2010-05-26 14:10:59 PDT
Comment on attachment 57132 [details]
Moved the advance logic from Heap::allocate to CollectorBitmap::advanceToNextPossibleFreeCell.

r=me
Comment 5 Geoffrey Garen 2010-05-27 13:30:05 PDT
Comment on attachment 57132 [details]
Moved the advance logic from Heap::allocate to CollectorBitmap::advanceToNextPossibleFreeCell.

Let's have auto-Eric take a crack at committing this.
Comment 6 WebKit Commit Bot 2010-05-27 14:45:22 PDT
Comment on attachment 57132 [details]
Moved the advance logic from Heap::allocate to CollectorBitmap::advanceToNextPossibleFreeCell.

Clearing flags on attachment: 57132

Committed r60323: <http://trac.webkit.org/changeset/60323>
Comment 7 WebKit Commit Bot 2010-05-27 14:45:28 PDT
All reviewed patches have been landed.  Closing bug.