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/CardSet.h

    r95865 r96372  
    3535template <size_t cardSize, size_t blockSize> class CardSet {
    3636    WTF_MAKE_NONCOPYABLE(CardSet);
     37
     38public:
    3739    static const size_t cardCount = (blockSize + cardSize - 1) / cardSize;
    3840
    39 public:
    4041    CardSet()
    4142    {
     
    4647    void markCardForAtom(const void*);
    4748    uint8_t& cardForAtom(const void*);
     49    bool isCardMarked(size_t);
     50    void clearCard(size_t);
    4851
    4952private:
     
    7073}
    7174
     75template <size_t cardSize, size_t blockSize> bool CardSet<cardSize, blockSize>::isCardMarked(size_t i)
     76{
     77    ASSERT(i < cardCount);
     78    return m_cards[i];
     79}
     80
     81template <size_t cardSize, size_t blockSize> void CardSet<cardSize, blockSize>::clearCard(size_t i)
     82{
     83    ASSERT(i < cardCount);
     84    m_cards[i] = 0;
     85}
     86
    7287}
    7388
Note: See TracChangeset for help on using the changeset viewer.