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/dfg/DFGPlan.cpp

    r190522 r190546  
    132132} // anonymous namespace
    133133
    134 Plan::Plan(CodeBlock* passedCodeBlock, CodeBlock* profiledDFGCodeBlock,
     134Plan::Plan(PassRefPtr<CodeBlock> passedCodeBlock, CodeBlock* profiledDFGCodeBlock,
    135135    CompilationMode mode, unsigned osrEntryBytecodeIndex,
    136136    const Operands<JSValue>& mustHandleValues)
     
    141141    , osrEntryBytecodeIndex(osrEntryBytecodeIndex)
    142142    , mustHandleValues(mustHandleValues)
    143     , compilation(codeBlock->vm()->m_perBytecodeProfiler ? adoptRef(new Profiler::Compilation(codeBlock->vm()->m_perBytecodeProfiler->ensureBytecodesFor(codeBlock), profilerCompilationKindForMode(mode))) : 0)
     143    , compilation(codeBlock->vm()->m_perBytecodeProfiler ? adoptRef(new Profiler::Compilation(codeBlock->vm()->m_perBytecodeProfiler->ensureBytecodesFor(codeBlock.get()), profilerCompilationKindForMode(mode))) : 0)
    144144    , inlineCallFrames(adoptRef(new InlineCallFrameSet()))
    145     , identifiers(codeBlock)
    146     , weakReferences(codeBlock)
     145    , identifiers(codeBlock.get())
     146    , weakReferences(codeBlock.get())
    147147    , willTryToTierUp(false)
    148148    , stage(Preparing)
     
    536536void Plan::reallyAdd(CommonData* commonData)
    537537{
    538     watchpoints.reallyAdd(codeBlock, *commonData);
     538    watchpoints.reallyAdd(codeBlock.get(), *commonData);
    539539    identifiers.reallyAdd(vm, commonData);
    540540    weakReferences.reallyAdd(vm, commonData);
     
    554554void Plan::notifyReady()
    555555{
    556     callback->compilationDidBecomeReadyAsynchronously(codeBlock, profiledDFGCodeBlock);
     556    callback->compilationDidBecomeReadyAsynchronously(codeBlock.get());
    557557    stage = Ready;
    558558}
     
    561561{
    562562    // We will establish new references from the code block to things. So, we need a barrier.
    563     vm.heap.writeBarrier(codeBlock);
     563    vm.heap.writeBarrier(codeBlock->ownerExecutable());
    564564   
    565565    if (!isStillValid())
     
    597597void Plan::finalizeAndNotifyCallback()
    598598{
    599     callback->compilationDidComplete(codeBlock, profiledDFGCodeBlock, finalizeWithoutNotifyingCallback());
     599    callback->compilationDidComplete(codeBlock.get(), finalizeWithoutNotifyingCallback());
    600600}
    601601
     
    605605}
    606606
    607 void Plan::rememberCodeBlocks()
     607void Plan::clearCodeBlockMarks()
    608608{
    609609    // Compilation writes lots of values to a CodeBlock without performing
     
    611611    // all our CodeBlocks must be visited during GC.
    612612
    613     Heap::heap(codeBlock)->writeBarrier(codeBlock);
     613    codeBlock->clearMarks();
     614    codeBlock->alternative()->clearMarks();
    614615    if (profiledDFGCodeBlock)
    615         Heap::heap(profiledDFGCodeBlock)->writeBarrier(profiledDFGCodeBlock);
     616        profiledDFGCodeBlock->clearMarks();
    616617}
    617618
     
    624625        visitor.appendUnbarrieredValue(&mustHandleValues[i]);
    625626
    626     visitor.appendUnbarrieredReadOnlyPointer(codeBlock);
    627     visitor.appendUnbarrieredReadOnlyPointer(profiledDFGCodeBlock);
     627    codeBlock->visitStrongly(visitor);
     628    codeBlock->alternative()->visitStrongly(visitor);
     629    if (profiledDFGCodeBlock)
     630        profiledDFGCodeBlock->visitStrongly(visitor);
    628631
    629632    if (inlineCallFrames) {
    630633        for (auto* inlineCallFrame : *inlineCallFrames) {
    631             ASSERT(inlineCallFrame->baselineCodeBlock.get());
    632             visitor.appendUnbarrieredReadOnlyPointer(inlineCallFrame->baselineCodeBlock.get());
     634            ASSERT(inlineCallFrame->baselineCodeBlock());
     635            inlineCallFrame->baselineCodeBlock()->visitStrongly(visitor);
    633636        }
    634637    }
Note: See TracChangeset for help on using the changeset viewer.