diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/heap/WeakSet.cpp | |
parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/heap/WeakSet.cpp')
-rw-r--r-- | Source/JavaScriptCore/heap/WeakSet.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/Source/JavaScriptCore/heap/WeakSet.cpp b/Source/JavaScriptCore/heap/WeakSet.cpp index 1eed8c37a..e62e66eae 100644 --- a/Source/JavaScriptCore/heap/WeakSet.cpp +++ b/Source/JavaScriptCore/heap/WeakSet.cpp @@ -27,7 +27,6 @@ #include "WeakSet.h" #include "Heap.h" -#include "JSCInlines.h" #include "VM.h" namespace JSC { @@ -37,26 +36,15 @@ WeakSet::~WeakSet() WeakBlock* next = 0; for (WeakBlock* block = m_blocks.head(); block; block = next) { next = block->next(); - WeakBlock::destroy(block); + heap()->blockAllocator().deallocate(WeakBlock::destroy(block)); } m_blocks.clear(); } void WeakSet::sweep() { - for (WeakBlock* block = m_blocks.head(); block;) { - WeakBlock* nextBlock = block->next(); + for (WeakBlock* block = m_blocks.head(); block; block = block->next()) block->sweep(); - if (block->isLogicallyEmptyButNotFree()) { - // If this WeakBlock is logically empty, but still has Weaks pointing into it, - // we can't destroy it just yet. Detach it from the WeakSet and hand ownership - // to the Heap so we don't pin down the entire 64kB MarkedBlock. - m_blocks.remove(block); - heap()->addLogicallyEmptyWeakBlock(block); - block->disconnectMarkedBlock(); - } - block = nextBlock; - } resetAllocator(); } @@ -85,7 +73,7 @@ WeakBlock::FreeCell* WeakSet::tryFindAllocator() WeakBlock::FreeCell* WeakSet::addAllocator() { - WeakBlock* block = WeakBlock::create(m_markedBlock); + WeakBlock* block = WeakBlock::create(heap()->blockAllocator().allocate<WeakBlock>()); heap()->didAllocate(WeakBlock::blockSize); m_blocks.append(block); WeakBlock::SweepResult sweepResult = block->takeSweepResult(); @@ -96,7 +84,7 @@ WeakBlock::FreeCell* WeakSet::addAllocator() void WeakSet::removeAllocator(WeakBlock* block) { m_blocks.remove(block); - WeakBlock::destroy(block); + heap()->blockAllocator().deallocate(WeakBlock::destroy(block)); } } // namespace JSC |