Changeset 124141 in webkit
- Timestamp:
- Jul 30, 2012 6:48:18 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r124123 r124141 1 2012-07-30 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r124123. 4 http://trac.webkit.org/changeset/124123 5 https://bugs.webkit.org/show_bug.cgi?id=92700 6 7 ASSERT crashes terminate webkit Layout tests (Requested by 8 msaboff on #webkit). 9 10 * heap/Heap.cpp: 11 * heap/Heap.h: 12 (Heap): 13 * heap/IncrementalSweeper.cpp: 14 (JSC::IncrementalSweeper::doSweep): 15 (JSC::IncrementalSweeper::startSweeping): 16 (JSC::IncrementalSweeper::IncrementalSweeper): 17 (JSC): 18 * heap/IncrementalSweeper.h: 19 (IncrementalSweeper): 20 * heap/MarkedAllocator.cpp: 21 (JSC::MarkedAllocator::tryAllocateHelper): 22 (JSC::MarkedAllocator::addBlock): 23 * heap/MarkedAllocator.h: 24 (JSC::MarkedAllocator::zapFreeList): 25 * heap/MarkedBlock.cpp: 26 (JSC::MarkedBlock::sweepHelper): 27 * heap/MarkedSpace.cpp: 28 * heap/MarkedSpace.h: 29 (JSC::MarkedSpace::sweep): 30 (JSC): 31 * runtime/JSGlobalData.cpp: 32 (JSC::JSGlobalData::~JSGlobalData): 33 1 34 2012-07-30 Mark Hahnenberg <mhahnenberg@apple.com> 2 35 -
trunk/Source/JavaScriptCore/heap/Heap.cpp
r124123 r124141 831 831 } 832 832 833 bool Heap::isSafeToSweepStructures()834 {835 return !m_sweeper || m_sweeper->structuresCanBeSwept();836 }837 838 void Heap::didStartVMShutdown()839 {840 m_activityCallback->didStartVMShutdown();841 m_activityCallback = 0;842 m_sweeper->didStartVMShutdown();843 m_sweeper = 0;844 lastChanceToFinalize();845 }846 847 833 } // namespace JSC -
trunk/Source/JavaScriptCore/heap/Heap.h
r124123 r124141 169 169 170 170 bool isPagedOut(double deadline); 171 bool isSafeToSweepStructures();172 void didStartVMShutdown();173 171 174 172 private: -
trunk/Source/JavaScriptCore/heap/IncrementalSweeper.cpp
r124123 r124141 70 70 } 71 71 72 bool IncrementalSweeper::structuresCanBeSwept()73 {74 ASSERT(m_currentBlockToSweepIndex <= m_blocksToSweep.size());75 return !m_blocksToSweep.size() || m_currentBlockToSweepIndex >= m_blocksToSweep.size();76 }77 78 72 void IncrementalSweeper::doSweep(double sweepBeginTime) 79 73 { 80 74 while (m_currentBlockToSweepIndex < m_blocksToSweep.size()) { 81 MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex]; 82 if (block->onlyContainsStructures()) { 83 m_currentBlockToSweepIndex++; 84 continue; 85 } 86 87 m_blocksToSweep[m_currentBlockToSweepIndex++] = 0; 88 89 if (!block->needsSweeping()) 90 continue; 91 92 block->sweep(); 93 m_globalData->heap.objectSpace().freeOrShrinkBlock(block); 94 95 CFTimeInterval elapsedTime = WTF::monotonicallyIncreasingTime() - sweepBeginTime; 96 if (elapsedTime < sweepTimeSlice) 97 continue; 98 99 scheduleTimer(); 100 return; 101 } 102 103 while (m_currentStructureBlockToSweepIndex < m_blocksToSweep.size()) { 104 MarkedBlock* block = m_blocksToSweep[m_currentStructureBlockToSweepIndex]; 105 if (!block) { 106 m_currentStructureBlockToSweepIndex++; 107 continue; 108 } 109 110 m_blocksToSweep[m_currentStructureBlockToSweepIndex++] = 0; 111 75 MarkedBlock* block = m_blocksToSweep[m_currentBlockToSweepIndex++]; 112 76 if (!block->needsSweeping()) 113 77 continue; … … 132 96 WTF::copyToVector(blockSnapshot, m_blocksToSweep); 133 97 m_currentBlockToSweepIndex = 0; 134 m_currentStructureBlockToSweepIndex = 0;135 98 scheduleTimer(); 136 }137 138 void IncrementalSweeper::willFinishSweeping()139 {140 m_currentBlockToSweepIndex = m_currentStructureBlockToSweepIndex = 0;141 m_blocksToSweep.clear();142 if (m_globalData)143 cancelTimer();144 99 } 145 100 … … 148 103 IncrementalSweeper::IncrementalSweeper(JSGlobalData* globalData) 149 104 : HeapTimer(globalData) 150 , m_structuresCanBeSwept(false)151 105 { 152 106 } … … 161 115 } 162 116 163 bool IncrementalSweeper::structuresCanBeSwept()164 {165 return m_structuresCanBeSwept;166 }167 168 117 void IncrementalSweeper::startSweeping(const HashSet<MarkedBlock*>&) 169 118 { 170 m_structuresCanBeSwept = false;171 119 } 172 173 void IncrementalSweeper::willFinishSweeping() 174 { 175 m_structuresCanBeSwept = true; 176 } 177 120 178 121 #endif 179 122 -
trunk/Source/JavaScriptCore/heap/IncrementalSweeper.h
r124123 r124141 43 43 void startSweeping(const HashSet<MarkedBlock*>& blockSnapshot); 44 44 virtual void doWork(); 45 bool structuresCanBeSwept();46 void willFinishSweeping();47 45 48 46 private: 49 50 47 #if USE(CF) 51 48 IncrementalSweeper(Heap*, CFRunLoopRef); … … 56 53 57 54 unsigned m_currentBlockToSweepIndex; 58 unsigned m_currentStructureBlockToSweepIndex;59 55 Vector<MarkedBlock*> m_blocksToSweep; 60 56 #else 61 57 62 58 IncrementalSweeper(JSGlobalData*); 63 64 bool m_structuresCanBeSwept; 65 59 66 60 #endif 67 61 }; -
trunk/Source/JavaScriptCore/heap/MarkedAllocator.cpp
r124123 r124141 4 4 #include "GCActivityCallback.h" 5 5 #include "Heap.h" 6 #include "IncrementalSweeper.h"7 6 #include "JSGlobalData.h" 8 7 #include <wtf/CurrentTime.h> … … 31 30 { 32 31 if (!m_freeList.head) { 33 if (m_onlyContainsStructures && !m_heap->isSafeToSweepStructures()) {34 if (m_currentBlock) {35 m_currentBlock->didConsumeFreeList();36 m_currentBlock = 0;37 }38 return 0;39 }40 41 32 for (MarkedBlock*& block = m_blocksToSweep; block; block = static_cast<MarkedBlock*>(block->next())) { 42 33 m_freeList = block->sweep(MarkedBlock::SweepToFreeList); … … 114 105 { 115 106 ASSERT(!m_currentBlock); 107 ASSERT(!m_blocksToSweep); 116 108 ASSERT(!m_freeList.head); 117 109 -
trunk/Source/JavaScriptCore/heap/MarkedAllocator.h
r124123 r124141 102 102 103 103 m_currentBlock->zapFreeList(m_freeList); 104 m_currentBlock = 0;105 104 m_freeList = MarkedBlock::FreeList(); 106 105 } -
trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp
r124123 r124141 27 27 #include "MarkedBlock.h" 28 28 29 #include "IncrementalSweeper.h"30 29 #include "JSCell.h" 31 30 #include "JSObject.h" … … 142 141 return FreeList(); 143 142 case Marked: 144 ASSERT(!m_onlyContainsStructures || heap()->isSafeToSweepStructures());145 143 return sweepMode == SweepToFreeList 146 144 ? specializedSweep<Marked, SweepToFreeList, destructorCallNeeded>() 147 145 : specializedSweep<Marked, SweepOnly, destructorCallNeeded>(); 148 146 case Zapped: 149 ASSERT(!m_onlyContainsStructures || heap()->isSafeToSweepStructures());150 147 return sweepMode == SweepToFreeList 151 148 ? specializedSweep<Zapped, SweepToFreeList, destructorCallNeeded>() -
trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp
r124123 r124141 22 22 #include "MarkedSpace.h" 23 23 24 #include "IncrementalSweeper.h"25 24 #include "JSGlobalObject.h" 26 25 #include "JSLock.h" … … 108 107 canonicalizeCellLivenessData(); 109 108 forEachBlock<LastChanceToFinalize>(); 110 }111 112 void MarkedSpace::sweep()113 {114 m_heap->sweeper()->willFinishSweeping();115 forEachBlock<Sweep>();116 109 } 117 110 -
trunk/Source/JavaScriptCore/heap/MarkedSpace.h
r124123 r124141 236 236 } 237 237 238 inline void MarkedSpace::sweep() 239 { 240 forEachBlock<Sweep>(); 241 } 242 238 243 inline size_t MarkedSpace::objectCount() 239 244 { -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r124123 r124141 224 224 { 225 225 ASSERT(!m_apiLock.currentThreadIsHoldingLock()); 226 heap.didStartVMShutdown(); 226 heap.activityCallback()->didStartVMShutdown(); 227 heap.sweeper()->didStartVMShutdown(); 228 heap.lastChanceToFinalize(); 227 229 228 230 delete interpreter;
Note: See TracChangeset
for help on using the changeset viewer.