Changeset 155632 in webkit
- Timestamp:
- Sep 12, 2013 11:13:25 AM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r155622 r155632 1 2013-09-12 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 MarkedBlocks shouldn't be put in Allocated state if they didn't produce a FreeList 4 https://bugs.webkit.org/show_bug.cgi?id=121236 5 6 Reviewed by Geoffrey Garen. 7 8 Right now, after a collection all MarkedBlocks are in the Marked block state. When lazy sweeping 9 happens, if a block returns an empty free list after being swept, we call didConsumeFreeList(), 10 which moves the block into the Allocated block state. This happens to both the block that was 11 just being allocated out of (i.e. m_currentBlock) as well as any blocks who are completely full. 12 We should distinguish between these two cases: m_currentBlock should transition to 13 Allocated (because we were just allocating out of it) and any subsequent block that returns an 14 empty free list should transition back to the Marked state. This will make the block state more 15 consistent with the actual state the block is in, and it will also allow us to speed up moving 16 all blocks to the Marked state during generational collection. 17 18 * heap/MarkedAllocator.cpp: 19 (JSC::MarkedAllocator::tryAllocateHelper): 20 * heap/MarkedBlock.h: 21 (JSC::MarkedBlock::didConsumeEmptyFreeList): 22 1 23 2013-09-12 Mark Lam <mark.lam@apple.com> 2 24 -
trunk/Source/JavaScriptCore/heap/MarkedAllocator.cpp
r153357 r155632 31 31 { 32 32 if (!m_freeList.head) { 33 if (m_currentBlock) { 34 ASSERT(m_currentBlock == m_blocksToSweep); 35 m_currentBlock->didConsumeFreeList(); 36 m_blocksToSweep = m_currentBlock->next(); 37 } 38 33 39 for (MarkedBlock*& block = m_blocksToSweep; block; block = block->next()) { 34 40 MarkedBlock::FreeList freeList = block->sweep(MarkedBlock::SweepToFreeList); 35 41 if (!freeList.head) { 36 block->didConsume FreeList();42 block->didConsumeEmptyFreeList(); 37 43 continue; 38 44 } -
trunk/Source/JavaScriptCore/heap/MarkedBlock.h
r155316 r155632 134 134 void didConsumeFreeList(); // Call this once you've allocated all the items in the free list. 135 135 void canonicalizeCellLivenessData(const FreeList&); 136 void didConsumeEmptyFreeList(); // Call this if you sweep a block, but the returned FreeList is empty. 136 137 137 138 // Returns true if the "newly allocated" bitmap was non-null … … 278 279 } 279 280 281 inline void MarkedBlock::didConsumeEmptyFreeList() 282 { 283 HEAP_LOG_BLOCK_STATE_TRANSITION(this); 284 285 ASSERT(m_state == FreeListed); 286 m_state = Marked; 287 } 288 280 289 inline void MarkedBlock::clearMarks() 281 290 {
Note: See TracChangeset
for help on using the changeset viewer.