Changeset 96432 in webkit for trunk/Source/JavaScriptCore/heap/Heap.cpp
- Timestamp:
- Sep 30, 2011, 3:23:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/Heap.cpp
r96372 r96432 215 215 : m_heapSize(heapSize) 216 216 , m_minBytesPerCycle(heapSizeForHint(heapSize)) 217 , m_lastFullGCSize(0) 217 218 , m_operationInProgress(NoOperation) 218 219 , m_objectSpace(this) … … 454 455 } 455 456 456 void Heap::markRoots() 457 { 457 void Heap::markRoots(bool fullGC) 458 { 459 UNUSED_PARAM(fullGC); 458 460 ASSERT(isValidThreadState(m_globalData)); 459 461 if (m_operationInProgress != NoOperation) … … 474 476 #if ENABLE(GGC) 475 477 MarkedBlock::DirtyCellVector dirtyCells; 476 // Until we have a sensible policy we just random choose to perform 477 // young generation collections 90% of the time. 478 if (WTF::randomNumber() > 0.1) 478 if (!fullGC) 479 479 m_objectSpace.gatherDirtyCells(dirtyCells); 480 480 else … … 487 487 488 488 #if ENABLE(GGC) 489 for (size_t i = 0; i < dirtyObjectCount; i++) { 489 size_t dirtyCellCount = dirtyCells.size(); 490 for (size_t i = 0; i < dirtyCellCount; i++) { 490 491 heapRootVisitor.visitChildren(dirtyCells[i]); 491 492 visitor.drain(); … … 600 601 ASSERT(m_isSafeToCollect); 601 602 JAVASCRIPTCORE_GC_BEGIN(); 602 603 bool fullGC = sweepToggle == DoSweep; 604 if (!fullGC) 605 fullGC = (capacity() > 4 * m_lastFullGCSize); 603 606 canonicalizeCellLivenessData(); 604 markRoots(); 607 608 markRoots(fullGC); 605 609 606 610 harvestWeakReferences(); … … 622 626 // new bytes allocated) proportion, and seems to work well in benchmarks. 623 627 size_t proportionalBytes = 2 * size(); 628 if (fullGC) 629 m_lastFullGCSize = proportionalBytes / 2; 630 624 631 m_objectSpace.setHighWaterMark(max(proportionalBytes, m_minBytesPerCycle)); 625 632 JAVASCRIPTCORE_GC_END();
Note:
See TracChangeset
for help on using the changeset viewer.