Ignore:
Timestamp:
May 23, 2012, 11:29:55 AM (13 years ago)
Author:
[email protected]
Message:

Encapsulated some calculations for whether portions of the heap are empty
https://bugs.webkit.org/show_bug.cgi?id=87210

Reviewed by Gavin Barraclough.

This is a step toward incremental DOM finalization.

  • heap/Heap.cpp:

(JSC::Heap::~Heap): Explicitly call freeAllBlocks() instead of relying
implicitly on all blocks thinking they're empty. In future, we may
choose to tear down the heap without first setting all data structures
to "empty".

  • heap/MarkedBlock.h:

(JSC::MarkedBlock::isEmpty):
(JSC::MarkedBlock::gatherDirtyCells): Renamed markCountIsZero to isEmpty,
in preparation for making it check for outstanding finalizers in addition
to marked cells.

  • heap/MarkedSpace.cpp:

(Take):
(JSC::Take::Take):
(JSC::Take::operator()):
(JSC::Take::returnValue):
(JSC::MarkedSpace::shrink):
(JSC::MarkedSpace::freeAllBlocks): Refactored the "Take" functor to support
a conditional isEmpty check, so it dould be shared by shrink() and freeAllBlocks().

  • heap/WeakBlock.cpp:

(JSC::WeakBlock::WeakBlock):
(JSC::WeakBlock::visitLiveWeakImpls):
(JSC::WeakBlock::visitDeadWeakImpls):

  • heap/WeakBlock.h:

(WeakBlock):
(JSC::WeakBlock::isEmpty):

  • heap/WeakSet.cpp:

(JSC::WeakSet::sweep):
(JSC::WeakSet::shrink): Use isEmpty(), in preparation for changes in
its implementation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/WeakBlock.h

    r115548 r118210  
    6161
    6262    static WeakImpl* asWeakImpl(FreeCell*);
     63
     64    bool isEmpty();
    6365
    6466    void sweep();
     
    152154}
    153155
     156inline bool WeakBlock::isEmpty()
     157{
     158    return !m_sweepResult.isNull() && m_sweepResult.blockIsFree;
     159}
     160
    154161} // namespace JSC
    155162
Note: See TracChangeset for help on using the changeset viewer.