Changeset 190589 in webkit for trunk/Source/JavaScriptCore/heap/Heap.cpp
- Timestamp:
- Oct 5, 2015, 4:31:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/Heap.cpp
r190569 r190589 383 383 RELEASE_ASSERT(m_operationInProgress == NoOperation); 384 384 385 m_codeBlocks.lastChanceToFinalize(); 385 386 m_objectSpace.lastChanceToFinalize(); 386 387 releaseDelayedReleasedObjects(); … … 521 522 ASSERT(isValidThreadState(m_vm)); 522 523 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 #endif529 if (m_operationInProgress == EdenCollection)530 m_codeBlocks.clearMarksForEdenCollection(rememberedSet);531 else532 m_codeBlocks.clearMarksForFullCollection();533 534 524 // We gather conservative roots before clearing mark bits because conservative 535 525 // gathering uses the mark bits to determine whether a reference is valid. … … 539 529 gatherScratchBufferRoots(conservativeRoots); 540 530 531 #if ENABLE(DFG_JIT) 532 DFG::rememberCodeBlocks(*m_vm); 533 #endif 534 535 if (m_operationInProgress == FullCollection) { 536 m_opaqueRoots.clear(); 537 m_slotVisitor.clearMarkStack(); 538 } 539 541 540 clearLivenessData(); 542 543 if (m_operationInProgress == FullCollection)544 m_opaqueRoots.clear();545 541 546 542 m_parallelMarkersShouldExit = false; … … 581 577 ParallelModeEnabler enabler(m_slotVisitor); 582 578 579 m_slotVisitor.donateAndDrain(); 583 580 visitExternalRememberedSet(); 584 581 visitSmallStrings(); … … 695 692 { 696 693 GCPHASE(ClearLivenessData); 694 if (m_operationInProgress == FullCollection) 695 m_codeBlocks.clearMarksForFullCollection(); 696 697 697 m_objectSpace.clearNewlyAllocated(); 698 698 m_objectSpace.clearMarks(); … … 816 816 { 817 817 GCPHASE(TraceCodeBlocksAndJITStubRoutines); 818 m_codeBlocks.traceMarked(m_slotVisitor);819 818 m_jitStubRoutines.traceMarkedStubRoutines(m_slotVisitor); 820 819 … … 950 949 // we'll end up returning to deleted code. 951 950 RELEASE_ASSERT(!m_vm->entryScope); 951 ASSERT(m_operationInProgress == NoOperation); 952 952 953 953 completeAllDFGPlans(); 954 954 955 for (ExecutableBase* current : m_executables) { 956 if (!current->isFunctionExecutable()) 957 continue; 958 static_cast<FunctionExecutable*>(current)->clearCode(); 959 } 960 961 ASSERT(m_operationInProgress == FullCollection || m_operationInProgress == NoOperation); 962 m_codeBlocks.clearMarksForFullCollection(); 963 m_codeBlocks.deleteUnmarkedAndUnreferenced(FullCollection); 955 for (ExecutableBase* executable : m_executables) 956 executable->clearCode(); 964 957 } 965 958 … … 981 974 continue; 982 975 983 // We do this because executable memory is limited on some platforms and because984 // CodeBlock requires eager finalization.985 ExecutableBase::clearCodeVirtual(current);976 // Eagerly dereference the Executable's JITCode in order to run watchpoint 977 // destructors. Otherwise, watchpoints might fire for deleted CodeBlocks. 978 current->clearCode(); 986 979 std::swap(m_executables[i], m_executables.last()); 987 980 m_executables.removeLast(); … … 1104 1097 deleteSourceProviderCaches(); 1105 1098 notifyIncrementalSweeper(); 1106 rememberCurrentlyExecutingCodeBlocks();1099 writeBarrierCurrentlyExecutingCodeBlocks(); 1107 1100 1108 1101 resetAllocators(); … … 1141 1134 if (shouldDoFullCollection(collectionType)) { 1142 1135 m_operationInProgress = FullCollection; 1143 m_slotVisitor.clearMarkStack();1144 1136 m_shouldDoFullCollection = false; 1145 1137 if (Options::logGC()) … … 1258 1250 } 1259 1251 1260 void Heap:: rememberCurrentlyExecutingCodeBlocks()1261 { 1262 GCPHASE( RememberCurrentlyExecutingCodeBlocks);1263 m_codeBlocks. rememberCurrentlyExecutingCodeBlocks(this);1252 void Heap::writeBarrierCurrentlyExecutingCodeBlocks() 1253 { 1254 GCPHASE(WriteBarrierCurrentlyExecutingCodeBlocks); 1255 m_codeBlocks.writeBarrierCurrentlyExecutingCodeBlocks(this); 1264 1256 } 1265 1257
Note:
See TracChangeset
for help on using the changeset viewer.