Ignore:
Timestamp:
May 20, 2012, 10:42:56 PM (13 years ago)
Author:
[email protected]
Message:

JSGlobalData ScratchBuffers Are Not Visited During Garbage Collection
https://bugs.webkit.org/show_bug.cgi?id=86553

Reviewed by Gavin Barraclough.

Scratch buffers can contain the only reference to live objects.
Therefore visit scratch buffer contents as conservative roots.
Changed the scratch buffers to be a struct with an "active"
length and the actual buffer. The users of the scratch
buffer emit code where needed to set and clear the active
length as appropriate. During marking, the active count is
used for conservative marking.

  • dfg/DFGAssemblyHelpers.h:

(JSC::DFG::AssemblyHelpers::debugCall):

  • dfg/DFGOSRExitCompiler32_64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGOSRExitCompiler64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrExitGenerationThunkGenerator):

  • heap/Heap.cpp:

(JSC::Heap::markRoots):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::gatherConservativeRoots):

  • runtime/JSGlobalData.h:

(JSC::ScratchBuffer::ScratchBuffer):
(ScratchBuffer):
(JSC::ScratchBuffer::allocationSize):
(JSC::ScratchBuffer::setActiveLength):
(JSC::ScratchBuffer::activeLength):
(JSC::ScratchBuffer::activeLengthPtr):
(JSC::ScratchBuffer::dataBuffer):
(JSGlobalData):
(JSC::JSGlobalData::scratchBufferForSize):

File:
1 edited

Legend:

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

    r117519 r117729  
    452452        registerFile().gatherConservativeRoots(registerFileRoots, m_dfgCodeBlocks);
    453453    }
     454
     455#if ENABLE(DFG_JIT)
     456    ConservativeRoots scratchBufferRoots(&m_objectSpace.blocks(), &m_storageSpace);
     457    {
     458        GCPHASE(GatherScratchBufferRoots);
     459        m_globalData->gatherConservativeRoots(scratchBufferRoots);
     460    }
     461#endif
     462
    454463#if ENABLE(GGC)
    455464    MarkedBlock::DirtyCellVector dirtyCells;
     
    498507            visitor.donateAndDrain();
    499508        }
     509#if ENABLE(DFG_JIT)
     510        {
     511            GCPHASE(VisitScratchBufferRoots);
     512            visitor.append(scratchBufferRoots);
     513            visitor.donateAndDrain();
     514        }
     515#endif
    500516        {
    501517            GCPHASE(VisitProtectedObjects);
Note: See TracChangeset for help on using the changeset viewer.