Changeset 276155 in webkit
- Timestamp:
- Apr 16, 2021, 12:24:22 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
heap/BlockDirectory.cpp (modified) (2 diffs)
-
heap/BlockDirectory.h (modified) (1 diff)
-
heap/MarkedBlock.cpp (modified) (1 diff)
-
heap/MarkedSpace.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r276121 r276155 1 2021-04-16 Keith Miller <keith_miller@apple.com> 2 3 Before deleting a MarkedBlock we do not need to clear its m_directory pointer. 4 https://bugs.webkit.org/show_bug.cgi?id=224677 5 6 Reviewed by Yusuke Suzuki. 7 8 Right now when we are about to free a MarkedBlock we clear the 9 m_directory pointer in the MarkedBlock's Handle. This has the 10 downside, however, of potentially paging in the footer from disk / 11 the compressor, which some data we have seen shows is happening. 12 This patch prevents this uncessary store to hopefully reduce the 13 number of pageins/decompressions caused by Safari web content. 14 15 * heap/BlockDirectory.cpp: 16 (JSC::BlockDirectory::removeBlock): 17 (JSC::BlockDirectory::removeBlockForDeletion): 18 * heap/BlockDirectory.h: 19 * heap/MarkedBlock.cpp: 20 (JSC::MarkedBlock::Handle::~Handle): 21 * heap/MarkedSpace.cpp: 22 (JSC::MarkedSpace::freeBlock): 23 1 24 2021-04-16 Mark Lam <mark.lam@apple.com> 2 25 -
trunk/Source/JavaScriptCore/heap/BlockDirectory.cpp
r261755 r276155 141 141 } 142 142 143 void BlockDirectory::removeBlock(MarkedBlock::Handle* block )143 void BlockDirectory::removeBlock(MarkedBlock::Handle* block, WillDeleteBlock willDelete) 144 144 { 145 145 ASSERT(block->directory() == this); … … 156 156 vectorRef[block->index()] = false; 157 157 }); 158 159 block->didRemoveFromDirectory(); 158 159 if (willDelete == WillDeleteBlock::No) 160 block->didRemoveFromDirectory(); 160 161 } 161 162 -
trunk/Source/JavaScriptCore/heap/BlockDirectory.h
r254023 r276155 84 84 85 85 void addBlock(MarkedBlock::Handle*); 86 void removeBlock(MarkedBlock::Handle*); 86 enum class WillDeleteBlock { No, Yes }; 87 // If WillDeleteBlock::Yes is passed then the block will be left in an invalid state. We do this, however, to avoid potentially paging in / decompressing old blocks to update their handle just before freeing them. 88 void removeBlock(MarkedBlock::Handle*, WillDeleteBlock = WillDeleteBlock::No); 87 89 88 90 bool isPagedOut(MonotonicTime deadline); -
trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp
r261895 r276155 77 77 dataLog("MarkedBlock Balance: ", balance, "\n"); 78 78 } 79 removeFromDirectory();79 m_directory->removeBlock(this, BlockDirectory::WillDeleteBlock::Yes); 80 80 m_block->~MarkedBlock(); 81 81 m_alignedMemoryAllocator->freeAlignedMemory(m_block); -
trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp
r275588 r276155 376 376 void MarkedSpace::freeBlock(MarkedBlock::Handle* block) 377 377 { 378 block->directory()->removeBlock(block);379 378 m_capacity -= MarkedBlock::blockSize; 380 379 m_blocks.remove(&block->block());
Note:
See TracChangeset
for help on using the changeset viewer.