summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/CodeBlockSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/heap/CodeBlockSet.h')
-rw-r--r--Source/JavaScriptCore/heap/CodeBlockSet.h39
1 files changed, 9 insertions, 30 deletions
diff --git a/Source/JavaScriptCore/heap/CodeBlockSet.h b/Source/JavaScriptCore/heap/CodeBlockSet.h
index 6cab875c9..791d18699 100644
--- a/Source/JavaScriptCore/heap/CodeBlockSet.h
+++ b/Source/JavaScriptCore/heap/CodeBlockSet.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,19 +26,16 @@
#ifndef CodeBlockSet_h
#define CodeBlockSet_h
-#include "GCSegmentedArray.h"
-#include "HeapOperation.h"
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/PassRefPtr.h>
-#include <wtf/PrintStream.h>
#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
namespace JSC {
class CodeBlock;
class Heap;
-class JSCell;
class SlotVisitor;
// CodeBlockSet tracks all CodeBlocks. Every CodeBlock starts out with one
@@ -55,22 +52,16 @@ public:
// Add a CodeBlock. This is only called by CodeBlock constructors.
void add(PassRefPtr<CodeBlock>);
- // Clear mark bits for certain CodeBlocks depending on the type of collection.
- void clearMarksForEdenCollection(const Vector<const JSCell*>&);
-
- // Clear all mark bits for all CodeBlocks.
- void clearMarksForFullCollection();
-
+ // Clear all mark bits associated with DFG code blocks.
+ void clearMarks();
+
// Mark a pointer that may be a CodeBlock that belongs to the set of DFG
// blocks. This is defined in CodeBlock.h.
- void mark(CodeBlock* candidateCodeBlock);
void mark(void* candidateCodeBlock);
// Delete all code blocks that are only referenced by this set (i.e. owned
// by this set), and that have not been marked.
- void deleteUnmarkedAndUnreferenced(HeapOperation);
-
- void remove(CodeBlock*);
+ void deleteUnmarkedAndUnreferenced();
// Trace all marked code blocks. The CodeBlock is free to make use of
// mayBeExecuting.
@@ -85,30 +76,18 @@ public:
// visited.
template<typename Functor> void iterate(Functor& functor)
{
- for (auto& codeBlock : m_oldCodeBlocks) {
- bool done = functor(codeBlock);
- if (done)
- return;
- }
-
- for (auto& codeBlock : m_newCodeBlocks) {
+ for (auto &codeBlock : m_set) {
bool done = functor(codeBlock);
if (done)
- return;
+ break;
}
}
-
- void dump(PrintStream&) const;
private:
- void clearMarksForCodeBlocksInRememberedExecutables(const Vector<const JSCell*>&);
- void promoteYoungCodeBlocks();
-
// This is not a set of RefPtr<CodeBlock> because we need to be able to find
// arbitrary bogus pointers. I could have written a thingy that had peek types
// and all, but that seemed like overkill.
- HashSet<CodeBlock*> m_oldCodeBlocks;
- HashSet<CodeBlock*> m_newCodeBlocks;
+ HashSet<CodeBlock* > m_set;
Vector<CodeBlock*> m_currentlyExecuting;
};