Ignore:
Timestamp:
Apr 27, 2012, 9:26:01 PM (13 years ago)
Author:
[email protected]
Message:

Stop using aligned allocation for WeakBlock
https://bugs.webkit.org/show_bug.cgi?id=85124

Reviewed by Anders Carlsson.

We don't actually use the alignment for anything.

  • heap/WeakBlock.cpp:

(JSC::WeakBlock::create):
(JSC::WeakBlock::WeakBlock): Switched from aligned allocation to regular
allocation.

  • heap/WeakBlock.h:

(WeakBlock): Don't use HeapBlock because HeapBlock requires aligned
allocation. This change required me to add some declarations that we used
to inherit from HeapBlock.

(WeakBlock::blockFor): Removed. This function relied on aligned allocation
but didn't do anything for us.

(WeakBlock::deallocate): Removed. WeakBlock doesn't own any of the deallocation
logic, so it shouldn't own the function.

  • heap/WeakSet.cpp:

(JSC::WeakSet::~WeakSet):
(JSC::WeakSet::finalizeAll):
(JSC::WeakSet::visitLiveWeakImpls):
(JSC::WeakSet::visitDeadWeakImpls):
(JSC::WeakSet::sweep):
(JSC::WeakSet::shrink):
(JSC::WeakSet::resetAllocator):
(JSC::WeakSet::tryFindAllocator):

  • heap/WeakSet.h:

(WeakSet): Updated declarations to reflect WeakBlock not inheriting from
HeapBlock. This allowed me to remove some casts, which was nice.

(JSC::WeakSet::deallocate): Directly set the deallocated flag instead of
asking WeakBlock to do it for us. We don't need to have a WeakBlock
pointer to set the flag, so stop asking for one.

File:
1 edited

Legend:

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

    r115092 r115538  
    5959    WeakBlock::FreeCell* m_allocator;
    6060    WeakBlock* m_nextAllocator;
    61     DoublyLinkedList<HeapBlock> m_blocks;
     61    DoublyLinkedList<WeakBlock> m_blocks;
    6262    Heap* m_heap;
    6363};
     
    8383inline void WeakSet::deallocate(WeakImpl* weakImpl)
    8484{
    85     WeakBlock::blockFor(weakImpl)->deallocate(weakImpl);
     85    weakImpl->setState(WeakImpl::Deallocated);
    8686}
    8787
Note: See TracChangeset for help on using the changeset viewer.