summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/HandleSet.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/heap/HandleSet.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/heap/HandleSet.h')
-rw-r--r--Source/JavaScriptCore/heap/HandleSet.h28
1 files changed, 7 insertions, 21 deletions
diff --git a/Source/JavaScriptCore/heap/HandleSet.h b/Source/JavaScriptCore/heap/HandleSet.h
index 58251f66a..458daeb4d 100644
--- a/Source/JavaScriptCore/heap/HandleSet.h
+++ b/Source/JavaScriptCore/heap/HandleSet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,11 +23,11 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HandleSet_h
-#define HandleSet_h
+#pragma once
#include "Handle.h"
#include "HandleBlock.h"
+#include "HeapCell.h"
#include <wtf/DoublyLinkedList.h>
#include <wtf/HashCountedSet.h>
#include <wtf/SentinelLinkedList.h>
@@ -35,9 +35,7 @@
namespace JSC {
-class HandleBlock;
class HandleSet;
-class HeapRootVisitor;
class VM;
class JSValue;
class SlotVisitor;
@@ -75,13 +73,13 @@ public:
HandleSlot allocate();
void deallocate(HandleSlot);
- void visitStrongHandles(HeapRootVisitor&);
+ void visitStrongHandles(SlotVisitor&);
JS_EXPORT_PRIVATE void writeBarrier(HandleSlot, const JSValue&);
unsigned protectedGlobalObjectCount();
- template<typename Functor> void forEachStrongHandle(Functor&, const HashCountedSet<JSCell*>& skipSet);
+ template<typename Functor> void forEachStrongHandle(const Functor&, const HashCountedSet<JSCell*>& skipSet);
private:
typedef HandleNode Node;
@@ -100,7 +98,6 @@ private:
SentinelLinkedList<Node> m_strongList;
SentinelLinkedList<Node> m_immediateList;
SinglyLinkedList<Node> m_freeList;
- Node* m_nextToFinalize;
};
inline HandleSet* HandleSet::heapFor(HandleSlot handle)
@@ -125,10 +122,6 @@ inline HandleSet::Node* HandleSet::toNode(HandleSlot handle)
inline HandleSlot HandleSet::allocate()
{
- // Forbid assignment to handles during the finalization phase, since it would violate many GC invariants.
- // File a bug with stack trace if you hit this.
- RELEASE_ASSERT(!m_nextToFinalize);
-
if (m_freeList.isEmpty())
grow();
@@ -141,11 +134,6 @@ inline HandleSlot HandleSet::allocate()
inline void HandleSet::deallocate(HandleSlot handle)
{
HandleSet::Node* node = toNode(handle);
- if (node == m_nextToFinalize) {
- ASSERT(m_nextToFinalize->next());
- m_nextToFinalize = m_nextToFinalize->next();
- }
-
SentinelLinkedList<HandleSet::Node>::remove(node);
m_freeList.push(node);
}
@@ -192,7 +180,7 @@ inline HandleNode* HandleNode::next()
return m_next;
}
-template<typename Functor> void HandleSet::forEachStrongHandle(Functor& functor, const HashCountedSet<JSCell*>& skipSet)
+template<typename Functor> void HandleSet::forEachStrongHandle(const Functor& functor, const HashCountedSet<JSCell*>& skipSet)
{
HandleSet::Node* end = m_strongList.end();
for (HandleSet::Node* node = m_strongList.begin(); node != end; node = node->next()) {
@@ -205,6 +193,4 @@ template<typename Functor> void HandleSet::forEachStrongHandle(Functor& functor,
}
}
-}
-
-#endif
+} // namespace JSC