Changeset 102917 in webkit for trunk/Source/JavaScriptCore/heap/MarkStack.cpp
- Timestamp:
- Dec 15, 2011, 4:01:30 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/MarkStack.cpp
r100242 r102917 29 29 #include "ConservativeRoots.h" 30 30 #include "Heap.h" 31 #include " Heuristics.h"31 #include "Options.h" 32 32 #include "JSArray.h" 33 33 #include "JSCell.h" … … 61 61 } 62 62 63 return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit( Heuristics::gcMarkStackSegmentSize));63 return static_cast<MarkStackSegment*>(OSAllocator::reserveAndCommit(Options::gcMarkStackSegmentSize)); 64 64 } 65 65 … … 82 82 MarkStackSegment* toFree = segments; 83 83 segments = segments->m_previous; 84 OSAllocator::decommitAndRelease(toFree, Heuristics::gcMarkStackSegmentSize);84 OSAllocator::decommitAndRelease(toFree, Options::gcMarkStackSegmentSize); 85 85 } 86 86 } … … 88 88 MarkStackArray::MarkStackArray(MarkStackSegmentAllocator& allocator) 89 89 : m_allocator(allocator) 90 , m_segmentCapacity(MarkStackSegment::capacityFromSize( Heuristics::gcMarkStackSegmentSize))90 , m_segmentCapacity(MarkStackSegment::capacityFromSize(Options::gcMarkStackSegmentSize)) 91 91 , m_top(0) 92 92 , m_numberOfPreviousSegments(0) … … 146 146 147 147 // Fast check: see if the other mark stack already has enough segments. 148 if (other.m_numberOfPreviousSegments + 1 >= Heuristics::maximumNumberOfSharedSegments)148 if (other.m_numberOfPreviousSegments + 1 >= Options::maximumNumberOfSharedSegments) 149 149 return false; 150 150 151 size_t numberOfCellsToKeep = Heuristics::minimumNumberOfCellsToKeep;151 size_t numberOfCellsToKeep = Options::minimumNumberOfCellsToKeep; 152 152 ASSERT(m_top > numberOfCellsToKeep || m_topSegment->m_previous); 153 153 … … 210 210 211 211 // Otherwise drain 1/Nth of the shared array where N is the number of 212 // workers, or Heuristics::minimumNumberOfCellsToKeep, whichever is bigger.213 size_t numberOfCellsToSteal = std::max((size_t) Heuristics::minimumNumberOfCellsToKeep, other.size() / Heuristics::numberOfGCMarkers);212 // workers, or Options::minimumNumberOfCellsToKeep, whichever is bigger. 213 size_t numberOfCellsToSteal = std::max((size_t)Options::minimumNumberOfCellsToKeep, other.size() / Options::numberOfGCMarkers); 214 214 while (numberOfCellsToSteal-- > 0 && other.canRemoveLast()) 215 215 append(other.removeLast()); … … 239 239 { 240 240 #if ENABLE(PARALLEL_GC) 241 for (unsigned i = 1; i < Heuristics::numberOfGCMarkers; ++i) {241 for (unsigned i = 1; i < Options::numberOfGCMarkers; ++i) { 242 242 m_markingThreads.append(createThread(markingThreadStartFunc, this, "JavaScriptCore::Marking")); 243 243 ASSERT(m_markingThreads.last()); … … 330 330 // Only wake up threads if the shared stack is big enough; otherwise assume that 331 331 // it's more profitable for us to just scan this ourselves later. 332 if (m_shared.m_sharedMarkStack.size() >= Heuristics::sharedStackWakeupThreshold)332 if (m_shared.m_sharedMarkStack.size() >= Options::sharedStackWakeupThreshold) 333 333 m_shared.m_markingCondition.broadcast(); 334 334 } … … 344 344 345 345 #if ENABLE(PARALLEL_GC) 346 if ( Heuristics::numberOfGCMarkers > 1) {346 if (Options::numberOfGCMarkers > 1) { 347 347 while (!m_stack.isEmpty()) { 348 348 m_stack.refill(); 349 for (unsigned countdown = Heuristics::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;)349 for (unsigned countdown = Options::minimumNumberOfScansBetweenRebalance; m_stack.canRemoveLast() && countdown--;) 350 350 visitChildren(*this, m_stack.removeLast(), jsFinalObjectVPtr, jsArrayVPtr, jsStringVPtr); 351 351 donateKnownParallel(); … … 368 368 ASSERT(m_isInParallelMode); 369 369 370 ASSERT( Heuristics::numberOfGCMarkers);370 ASSERT(Options::numberOfGCMarkers); 371 371 372 372 bool shouldBeParallel; 373 373 374 374 #if ENABLE(PARALLEL_GC) 375 shouldBeParallel = Heuristics::numberOfGCMarkers > 1;375 shouldBeParallel = Options::numberOfGCMarkers > 1; 376 376 #else 377 ASSERT( Heuristics::numberOfGCMarkers == 1);377 ASSERT(Options::numberOfGCMarkers == 1); 378 378 shouldBeParallel = false; 379 379 #endif
Note:
See TracChangeset
for help on using the changeset viewer.