summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/WeakBlock.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
commita89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch)
treeb7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Source/JavaScriptCore/heap/WeakBlock.h
parent8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff)
downloadqtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Source/JavaScriptCore/heap/WeakBlock.h')
-rw-r--r--Source/JavaScriptCore/heap/WeakBlock.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/JavaScriptCore/heap/WeakBlock.h b/Source/JavaScriptCore/heap/WeakBlock.h
index 9e546ea32..dc3e89d55 100644
--- a/Source/JavaScriptCore/heap/WeakBlock.h
+++ b/Source/JavaScriptCore/heap/WeakBlock.h
@@ -30,7 +30,6 @@
#include "WeakHandleOwner.h"
#include "WeakImpl.h"
#include <wtf/DoublyLinkedList.h>
-#include <wtf/PageAllocation.h>
#include <wtf/StdLibExtras.h>
namespace JSC {
@@ -42,7 +41,7 @@ class WeakHandleOwner;
class WeakBlock : public DoublyLinkedListNode<WeakBlock> {
public:
friend class WTF::DoublyLinkedListNode<WeakBlock>;
- static const size_t blockSize = 4 * KB;
+ static const size_t blockSize = 3 * KB; // 5% of MarkedBlock size
struct FreeCell {
FreeCell* next;
@@ -61,26 +60,26 @@ public:
static WeakImpl* asWeakImpl(FreeCell*);
+ bool isEmpty();
+
void sweep();
- const SweepResult& sweepResult();
SweepResult takeSweepResult();
- void visitLiveWeakImpls(HeapRootVisitor&);
- void visitDeadWeakImpls(HeapRootVisitor&);
+ void visit(HeapRootVisitor&);
+ void reap();
- void finalizeAll();
+ void lastChanceToFinalize();
private:
static FreeCell* asFreeCell(WeakImpl*);
- WeakBlock(PageAllocation&);
+ WeakBlock();
WeakImpl* firstWeakImpl();
void finalize(WeakImpl*);
WeakImpl* weakImpls();
size_t weakImplCount();
void addToFreeList(FreeCell**, WeakImpl*);
- PageAllocation m_allocation;
WeakBlock* m_prev;
WeakBlock* m_next;
SweepResult m_sweepResult;
@@ -111,11 +110,6 @@ inline WeakBlock::SweepResult WeakBlock::takeSweepResult()
return tmp;
}
-inline const WeakBlock::SweepResult& WeakBlock::sweepResult()
-{
- return m_sweepResult;
-}
-
inline WeakBlock::FreeCell* WeakBlock::asFreeCell(WeakImpl* weakImpl)
{
return reinterpret_cast<FreeCell*>(weakImpl);
@@ -151,6 +145,11 @@ inline void WeakBlock::addToFreeList(FreeCell** freeList, WeakImpl* weakImpl)
*freeList = freeCell;
}
+inline bool WeakBlock::isEmpty()
+{
+ return !m_sweepResult.isNull() && m_sweepResult.blockIsFree;
+}
+
} // namespace JSC
#endif // WeakBlock_h