Changeset 167772 in webkit
- Timestamp:
- Apr 24, 2014 2:12:56 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r167733 r167772 1 2014-04-24 Mark Lam <mark.lam@apple.com> 2 3 Make slowPathAllocsBetweenGCs a runtime option. 4 <https://webkit.org/b/132137> 5 6 Reviewed by Mark Hahnenberg. 7 8 This will make it easier to more casually run tests with this configuration 9 as well as to reproduce issues (instead of requiring a code mod and rebuild). 10 We will now take --slowPathAllocsBetweenGCs=N where N is the number of 11 slow path allocations before we trigger a collection. 12 13 The option defaults to 0, which is reserved to mean that we will not trigger 14 any collections there. 15 16 * heap/Heap.h: 17 * heap/MarkedAllocator.cpp: 18 (JSC::MarkedAllocator::doTestCollectionsIfNeeded): 19 (JSC::MarkedAllocator::allocateSlowCase): 20 * heap/MarkedAllocator.h: 21 * runtime/Options.h: 22 1 23 2014-04-23 Mark Lam <mark.lam@apple.com> 2 24 -
trunk/Source/JavaScriptCore/heap/Heap.h
r167733 r167772 45 45 #include <wtf/HashCountedSet.h> 46 46 #include <wtf/HashSet.h> 47 48 #define COLLECT_ON_EVERY_ALLOCATION 049 47 50 48 namespace JSC { -
trunk/Source/JavaScriptCore/heap/MarkedAllocator.cpp
r165486 r167772 144 144 return result; 145 145 } 146 146 147 ALWAYS_INLINE void MarkedAllocator::doTestCollectionsIfNeeded() 148 { 149 if (!Options::slowPathAllocsBetweenGCs()) 150 return; 151 152 static unsigned allocationCount = 0; 153 if (!allocationCount) { 154 if (!m_heap->isDeferred()) 155 m_heap->collectAllGarbage(); 156 ASSERT(m_heap->m_operationInProgress == NoOperation); 157 } 158 if (++allocationCount >= Options::slowPathAllocsBetweenGCs()) 159 allocationCount = 0; 160 } 161 147 162 void* MarkedAllocator::allocateSlowCase(size_t bytes) 148 163 { 149 164 ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock()); 150 #if COLLECT_ON_EVERY_ALLOCATION 151 if (!m_heap->isDeferred()) 152 m_heap->collectAllGarbage(); 153 ASSERT(m_heap->m_operationInProgress == NoOperation); 154 #endif 155 165 doTestCollectionsIfNeeded(); 166 156 167 ASSERT(!m_markedSpace->isIterating()); 157 168 ASSERT(!m_freeList.head); -
trunk/Source/JavaScriptCore/heap/MarkedAllocator.h
r165486 r167772 51 51 void* tryPopFreeList(size_t); 52 52 MarkedBlock* allocateBlock(size_t); 53 ALWAYS_INLINE void doTestCollectionsIfNeeded(); 53 54 54 55 MarkedBlock::FreeList m_freeList; -
trunk/Source/JavaScriptCore/runtime/Options.h
r167515 r167772 251 251 v(double, minCopiedBlockUtilization, 0.9) \ 252 252 v(double, minMarkedBlockUtilization, 0.9) \ 253 v(unsigned, slowPathAllocsBetweenGCs, 0) \ 253 254 \ 254 255 v(double, percentCPUPerMBForFullTimer, 0.0003125) \
Note: See TracChangeset
for help on using the changeset viewer.