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

    r118238 r118269  
    3636class WeakSet {
    3737public:
    38     WeakSet(Heap*);
    39     void lastChanceToFinalize();
    40     ~WeakSet();
    41 
    4238    static WeakImpl* allocate(JSValue, WeakHandleOwner* = 0, void* context = 0);
    4339    static void deallocate(WeakImpl*);
    4440
    45     void visitLiveWeakImpls(HeapRootVisitor&);
    46     void visitDeadWeakImpls(HeapRootVisitor&);
     41    WeakSet(Heap*);
     42    ~WeakSet();
     43    void lastChanceToFinalize();
     44
     45    void visit(HeapRootVisitor&);
     46    void reap();
    4747
    4848    void sweep();
Note: See TracChangeset for help on using the changeset viewer.