Changeset 77094 in webkit for trunk/Source/JavaScriptCore/runtime/Heap.cpp
- Timestamp:
- Jan 30, 2011, 3:07:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Heap.cpp
r77081 r77094 91 91 // collecting more frequently as long as it stays alive. 92 92 93 if (m_extraCost > maxExtraCost && m_extraCost > m_markedSpace.capacity() / 2) { 94 JAVASCRIPTCORE_GC_BEGIN(); 95 96 markRoots(); 97 98 JAVASCRIPTCORE_GC_MARKED(); 99 100 m_markedSpace.reset(); 101 m_extraCost = 0; 102 103 JAVASCRIPTCORE_GC_END(); 104 105 (*m_activityCallback)(); 106 } 93 if (m_extraCost > maxExtraCost && m_extraCost > m_markedSpace.capacity() / 2) 94 collectAllGarbage(); 107 95 m_extraCost += cost; 108 96 } … … 124 112 void* result = m_markedSpace.allocate(s); 125 113 m_operationInProgress = NoOperation; 126 127 114 if (!result) { 128 JAVASCRIPTCORE_GC_BEGIN(); 129 130 markRoots(); 131 132 JAVASCRIPTCORE_GC_MARKED(); 133 134 m_markedSpace.reset(); 135 m_extraCost = 0; 136 137 JAVASCRIPTCORE_GC_END(); 138 139 (*m_activityCallback)(); 115 reset(DoNotSweep); 140 116 141 117 m_operationInProgress = Allocation; … … 143 119 m_operationInProgress = NoOperation; 144 120 } 121 145 122 ASSERT(result); 146 123 return result; … … 390 367 void Heap::collectAllGarbage() 391 368 { 369 reset(DoSweep); 370 } 371 372 void Heap::reset(SweepToggle sweepToggle) 373 { 392 374 ASSERT(globalData()->identifierTable == wtfThreadData().currentIdentifierTable()); 393 375 JAVASCRIPTCORE_GC_BEGIN(); … … 398 380 399 381 m_markedSpace.reset(); 400 m_markedSpace.sweep();401 382 m_extraCost = 0; 402 383 384 if (sweepToggle == DoSweep) 385 m_markedSpace.sweep(); 386 403 387 JAVASCRIPTCORE_GC_END(); 404 388
Note:
See TracChangeset
for help on using the changeset viewer.