WeakBlocks should be HeapBlocks
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2012 23:34:30 +0000 (23:34 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2012 23:34:30 +0000 (23:34 +0000)
commit6c218bc4c435a1b00d010980d7aa331480e12155
treed951ced6b3ca3e9318d333a041b4c1687e15eb63
parent93cf82d576d2ac1cbbe94b3e4afe8202548d6523
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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@133812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/BlockAllocator.cpp
Source/JavaScriptCore/heap/BlockAllocator.h
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/WeakBlock.cpp
Source/JavaScriptCore/heap/WeakBlock.h
Source/JavaScriptCore/heap/WeakSet.cpp