Ignore:
Timestamp:
Sep 29, 2011, 3:52:45 PM (14 years ago)
Author:
[email protected]
Message:

Add logic to collect dirty objects as roots
https://bugs.webkit.org/show_bug.cgi?id=69100

Reviewed by Geoff Garen.

This gives us the ability to walk all the MarkedBlocks in an
AllocationSpace and collect the dirty objects, and then use
them as GC roots.

  • dfg/DFGJITCodeGenerator.cpp:

(JSC::DFG::JITCodeGenerator::markCellCard):

  • dfg/DFGJITCodeGenerator32_64.cpp:

(JSC::DFG::JITCodeGenerator::markCellCard):

  • heap/AllocationSpace.cpp:

Tidy up the write barrier logic a bit

(JSC::MarkedBlock::gatherDirtyObjects):
(JSC::TakeIfDirty::returnValue):
(JSC::TakeIfDirty::TakeIfDirty):
(JSC::TakeIfDirty::operator()):
(JSC::AllocationSpace::gatherDirtyObjects):

  • heap/AllocationSpace.h:
  • heap/CardSet.h:

(JSC::::isCardMarked):
(JSC::::clearCard):

  • heap/Heap.cpp:

(JSC::Heap::markRoots):

  • heap/Heap.h:

(JSC::Heap::writeBarrier):

  • heap/MarkStack.cpp:

(JSC::SlotVisitor::visitChildren):

  • heap/MarkedBlock.h:

(JSC::MarkedBlock::setDirtyObject):
(JSC::MarkedBlock::addressOfCardFor):

  • heap/SlotVisitor.h:
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitWriteBarrier):

Tidy the write barrier a bit

File:
1 edited

Legend:

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

    r95912 r96372  
    163163}
    164164
     165#if ENABLE(GGC)
     166class GatherDirtyCells {
     167    WTF_MAKE_NONCOPYABLE(GatherDirtyCells);
     168public:
     169    typedef void* ReturnType;
     170   
     171    explicit GatherDirtyCells(MarkedBlock::DirtyCellVector*);
     172    void operator()(MarkedBlock*);
     173    ReturnType returnValue() { return 0; }
     174   
     175private:
     176    MarkedBlock::DirtyCellVector* m_dirtyCells;
     177};
     178
     179inline GatherDirtyCells::GatherDirtyCells(MarkedBlock::DirtyCellVector* dirtyCells)
     180    : m_dirtyCells(dirtyCells)
     181{
    165182}
     183
     184inline void GatherDirtyCells::operator()(MarkedBlock* block)
     185{
     186    block->gatherDirtyCells(*m_dirtyCells);
     187}
     188
     189void AllocationSpace::gatherDirtyCells(MarkedBlock::DirtyCellVector& dirtyCells)
     190{
     191    GatherDirtyCells gatherDirtyCells(&dirtyCells);
     192    forEachBlock(gatherDirtyCells);
     193}
     194#endif
     195
     196}
Note: See TracChangeset for help on using the changeset viewer.