Changeset 276175 in webkit
- Timestamp:
- Apr 16, 2021, 3:28:44 PM (5 years ago)
- Location:
- branches/safari-611-branch/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
-
branches/safari-611-branch/Source/JavaScriptCore/ChangeLog
r276096 r276175 1 2021-04-16 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r276155. rdar://problem/76781047 4 5 Before deleting a MarkedBlock we do not need to clear its m_directory pointer. 6 https://bugs.webkit.org/show_bug.cgi?id=224677 7 8 Reviewed by Yusuke Suzuki. 9 10 Right now when we are about to free a MarkedBlock we clear the 11 m_directory pointer in the MarkedBlock's Handle. This has the 12 downside, however, of potentially paging in the footer from disk / 13 the compressor, which some data we have seen shows is happening. 14 This patch prevents this uncessary store to hopefully reduce the 15 number of pageins/decompressions caused by Safari web content. 16 17 * heap/BlockDirectory.cpp: 18 (JSC::BlockDirectory::removeBlock): 19 (JSC::BlockDirectory::removeBlockForDeletion): 20 * heap/BlockDirectory.h: 21 * heap/MarkedBlock.cpp: 22 (JSC::MarkedBlock::Handle::~Handle): 23 * heap/MarkedSpace.cpp: 24 (JSC::MarkedSpace::freeBlock): 25 26 27 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276155 268f45cc-cd09-0410-ab3c-d52691b4dbfc 28 29 2021-04-16 Keith Miller <keith_miller@apple.com> 30 31 Before deleting a MarkedBlock we do not need to clear its m_directory pointer. 32 https://bugs.webkit.org/show_bug.cgi?id=224677 33 34 Reviewed by Yusuke Suzuki. 35 36 Right now when we are about to free a MarkedBlock we clear the 37 m_directory pointer in the MarkedBlock's Handle. This has the 38 downside, however, of potentially paging in the footer from disk / 39 the compressor, which some data we have seen shows is happening. 40 This patch prevents this uncessary store to hopefully reduce the 41 number of pageins/decompressions caused by Safari web content. 42 43 * heap/BlockDirectory.cpp: 44 (JSC::BlockDirectory::removeBlock): 45 (JSC::BlockDirectory::removeBlockForDeletion): 46 * heap/BlockDirectory.h: 47 * heap/MarkedBlock.cpp: 48 (JSC::MarkedBlock::Handle::~Handle): 49 * heap/MarkedSpace.cpp: 50 (JSC::MarkedSpace::freeBlock): 51 1 52 2021-04-15 Russell Epstein <repstein@apple.com> 2 53 -
branches/safari-611-branch/Source/JavaScriptCore/heap/BlockDirectory.cpp
r261755 r276175 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 -
branches/safari-611-branch/Source/JavaScriptCore/heap/BlockDirectory.h
r254023 r276175 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); -
branches/safari-611-branch/Source/JavaScriptCore/heap/MarkedBlock.cpp
r261895 r276175 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); -
branches/safari-611-branch/Source/JavaScriptCore/heap/MarkedSpace.cpp
r262786 r276175 372 372 void MarkedSpace::freeBlock(MarkedBlock::Handle* block) 373 373 { 374 block->directory()->removeBlock(block);375 374 m_capacity -= MarkedBlock::blockSize; 376 375 m_blocks.remove(&block->block());
Note:
See TracChangeset
for help on using the changeset viewer.