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/WeakSet.cpp

    r115538 r118210  
    6666
    6767        // If a block is completely empty, a new sweep won't have any effect.
    68         if (!block->sweepResult().isNull() && block->sweepResult().blockIsFree)
     68        if (block->isEmpty())
    6969            continue;
    7070
     
    8080        next = block->next();
    8181
    82         if (!block->sweepResult().isNull() && block->sweepResult().blockIsFree)
     82        if (block->isEmpty())
    8383            removeAllocator(block);
    8484    }
Note: See TracChangeset for help on using the changeset viewer.