Ignore:
Timestamp:
May 23, 2012, 4:55:27 PM (13 years ago)
Author:
[email protected]
Message:

Refactored WeakBlock to use malloc, clarify behavior
https://bugs.webkit.org/show_bug.cgi?id=87318

Reviewed by Filip Pizlo.

We want to use malloc so we can make these smaller than 4KB,
since an individual MarkedBlock will usually have fewer than
4KB worth of weak pointers.

  • heap/Heap.cpp:

(JSC::Heap::markRoots): Renamed visitLiveWeakImpls to visit, since
we no longer need to distinguish from "visitDeadWeakImpls".

Renamed "visitDeadWeakImpls" to "reap" because we're not actually
doing any visiting -- we're just tagging things as dead.

  • heap/WeakBlock.cpp:

(JSC::WeakBlock::create):
(JSC::WeakBlock::destroy):
(JSC::WeakBlock::WeakBlock): Malloc!

(JSC::WeakBlock::visit):
(JSC::WeakBlock::reap): Renamed as above.

  • heap/WeakBlock.h:

(WeakBlock): Reduced to 3KB, as explained above.

  • heap/WeakSet.cpp:

(JSC::WeakSet::visit):
(JSC::WeakSet::reap):

  • heap/WeakSet.h:

(WeakSet): Updated for renames, and to match WebKit style.

File:
1 edited

Legend:

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

    r118238 r118269  
    562562        GCPHASE(VisitingLiveWeakHandles);
    563563        while (true) {
    564             m_weakSet.visitLiveWeakImpls(heapRootVisitor);
     564            m_weakSet.visit(heapRootVisitor);
    565565            harvestWeakReferences();
    566566            if (visitor.isEmpty())
     
    577577
    578578    {
    579         GCPHASE(VisitingDeadWeakHandles);
    580         m_weakSet.visitDeadWeakImpls(heapRootVisitor);
     579        GCPHASE(ReapingWeakHandles);
     580        m_weakSet.reap();
    581581    }
    582582
Note: See TracChangeset for help on using the changeset viewer.