Ignore:
Timestamp:
Oct 3, 2015, 6:45:21 PM (10 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r190522.
https://bugs.webkit.org/show_bug.cgi?id=149787

Caused a lot of leaks (Requested by ap on #webkit).

Reverted changeset:

"Unreviewed, rolling back in r190450"
https://bugs.webkit.org/show_bug.cgi?id=149727
http://trac.webkit.org/changeset/190522

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r190527 r190546  
    521521    ASSERT(isValidThreadState(m_vm));
    522522
     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
    523534    // We gather conservative roots before clearing mark bits because conservative
    524535    // gathering uses the mark bits to determine whether a reference is valid.
     
    528539    gatherScratchBufferRoots(conservativeRoots);
    529540
    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)
    535544        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 
    544545
    545546    m_shouldHashCons = m_vm->haveEnoughNewStringsToHashCons();
     
    582583        ParallelModeEnabler enabler(m_slotVisitor);
    583584
    584         m_slotVisitor.donateAndDrain();
    585585        visitExternalRememberedSet();
    586586        visitSmallStrings();
     
    698698{
    699699    GCPHASE(ClearLivenessData);
    700     if (m_operationInProgress == FullCollection)
    701         m_codeBlocks.clearMarksForFullCollection();
    702 
    703700    m_objectSpace.clearNewlyAllocated();
    704701    m_objectSpace.clearMarks();
     
    822819{
    823820    GCPHASE(TraceCodeBlocksAndJITStubRoutines);
     821    m_codeBlocks.traceMarked(m_slotVisitor);
    824822    m_jitStubRoutines.traceMarkedStubRoutines(m_slotVisitor);
    825823
     
    966964    // we'll end up returning to deleted code.
    967965    RELEASE_ASSERT(!m_vm->entryScope);
    968     ASSERT(m_operationInProgress == NoOperation);
    969966
    970967    completeAllDFGPlans();
    971968
    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);
    974978}
    975979
     
    991995            continue;
    992996
    993         // Eagerly dereference the Executable's JITCode in order to run watchpoint
    994         // 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);
    9961000        std::swap(m_executables[i], m_executables.last());
    9971001        m_executables.removeLast();
     
    11471151    if (shouldDoFullCollection(collectionType)) {
    11481152        m_operationInProgress = FullCollection;
     1153        m_slotVisitor.clearMarkStack();
    11491154        m_shouldDoFullCollection = false;
    11501155        if (Options::logGC())
Note: See TracChangeset for help on using the changeset viewer.