Ignore:
Timestamp:
Nov 7, 2012, 3:34:30 PM (13 years ago)
Author:
[email protected]
Message:

WeakBlocks should be HeapBlocks
https://bugs.webkit.org/show_bug.cgi?id=101411

Reviewed by Oliver Hunt.

Currently WeakBlocks use fastMalloc memory. They are very similar to the other HeapBlocks, however,
so we should change them to being allocated with the BlockAllocator.

  • heap/BlockAllocator.cpp:

(JSC::BlockAllocator::BlockAllocator):

  • heap/BlockAllocator.h: Added a new RegionSet for WeakBlocks.

(JSC):
(BlockAllocator):
(JSC::WeakBlock):

  • heap/Heap.h: Friended WeakSet to allow access to the BlockAllocator.

(Heap):

  • heap/WeakBlock.cpp:

(JSC::WeakBlock::create): Refactored to use HeapBlocks rather than fastMalloc.
(JSC::WeakBlock::WeakBlock):

  • heap/WeakBlock.h: Changed the WeakBlock size to 4 KB so that it divides evenly into the Region size.

(JSC):
(WeakBlock):

  • heap/WeakSet.cpp:

(JSC::WeakSet::~WeakSet):
(JSC::WeakSet::addAllocator):

File:
1 edited

Legend:

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

    r133358 r133812  
    189189        friend class IncrementalSweeper;
    190190        friend class HeapStatistics;
     191        friend class WeakSet;
    191192        template<typename T> friend void* allocateCell(Heap&);
    192193        template<typename T> friend void* allocateCell(Heap&, size_t);
Note: See TracChangeset for help on using the changeset viewer.