Changeset 190546 in webkit for trunk/Source/JavaScriptCore/heap/Heap.cpp
- Timestamp:
- Oct 3, 2015, 6:45:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/Heap.cpp
r190527 r190546 521 521 ASSERT(isValidThreadState(m_vm)); 522 522 523 Vector<const JSCell*> rememberedSet(m_slotVisitor.markStack().size()); 524 m_slotVisitor.markStack().fillVector(rememberedSet); 525 526 #if ENABLE(DFG_JIT) 527 DFG::clearCodeBlockMarks(*m_vm); 528 #endif 529 if (m_operationInProgress == EdenCollection) 530 m_codeBlocks.clearMarksForEdenCollection(rememberedSet); 531 else 532 m_codeBlocks.clearMarksForFullCollection(); 533 523 534 // We gather conservative roots before clearing mark bits because conservative 524 535 // gathering uses the mark bits to determine whether a reference is valid. … … 528 539 gatherScratchBufferRoots(conservativeRoots); 529 540 530 #if ENABLE(DFG_JIT) 531 DFG::rememberCodeBlocks(*m_vm); 532 #endif 533 534 if (m_operationInProgress == FullCollection) { 541 clearLivenessData(); 542 543 if (m_operationInProgress == FullCollection) 535 544 m_opaqueRoots.clear(); 536 m_slotVisitor.clearMarkStack();537 }538 539 Vector<const JSCell*> rememberedSet(m_slotVisitor.markStack().size());540 m_slotVisitor.markStack().fillVector(rememberedSet);541 542 clearLivenessData();543 544 545 545 546 m_shouldHashCons = m_vm->haveEnoughNewStringsToHashCons(); … … 582 583 ParallelModeEnabler enabler(m_slotVisitor); 583 584 584 m_slotVisitor.donateAndDrain();585 585 visitExternalRememberedSet(); 586 586 visitSmallStrings(); … … 698 698 { 699 699 GCPHASE(ClearLivenessData); 700 if (m_operationInProgress == FullCollection)701 m_codeBlocks.clearMarksForFullCollection();702 703 700 m_objectSpace.clearNewlyAllocated(); 704 701 m_objectSpace.clearMarks(); … … 822 819 { 823 820 GCPHASE(TraceCodeBlocksAndJITStubRoutines); 821 m_codeBlocks.traceMarked(m_slotVisitor); 824 822 m_jitStubRoutines.traceMarkedStubRoutines(m_slotVisitor); 825 823 … … 966 964 // we'll end up returning to deleted code. 967 965 RELEASE_ASSERT(!m_vm->entryScope); 968 ASSERT(m_operationInProgress == NoOperation);969 966 970 967 completeAllDFGPlans(); 971 968 972 for (ExecutableBase* executable : m_executables) 973 executable->clearCode(); 969 for (ExecutableBase* current : m_executables) { 970 if (!current->isFunctionExecutable()) 971 continue; 972 static_cast<FunctionExecutable*>(current)->clearCode(); 973 } 974 975 ASSERT(m_operationInProgress == FullCollection || m_operationInProgress == NoOperation); 976 m_codeBlocks.clearMarksForFullCollection(); 977 m_codeBlocks.deleteUnmarkedAndUnreferenced(FullCollection); 974 978 } 975 979 … … 991 995 continue; 992 996 993 // Eagerly dereference the Executable's JITCode in order to run watchpoint994 // destructors. Otherwise, watchpoints might fire for deleted CodeBlocks.995 current->clearCode();997 // We do this because executable memory is limited on some platforms and because 998 // CodeBlock requires eager finalization. 999 ExecutableBase::clearCodeVirtual(current); 996 1000 std::swap(m_executables[i], m_executables.last()); 997 1001 m_executables.removeLast(); … … 1147 1151 if (shouldDoFullCollection(collectionType)) { 1148 1152 m_operationInProgress = FullCollection; 1153 m_slotVisitor.clearMarkStack(); 1149 1154 m_shouldDoFullCollection = false; 1150 1155 if (Options::logGC())
Note:
See TracChangeset
for help on using the changeset viewer.