Index: src/heap/remembered-set.h |
diff --git a/src/heap/remembered-set.h b/src/heap/remembered-set.h |
index bfba8893ea8f9504dcb5562f09dc0b99c119a929..45408bf1e9dadf9952af8a70b5e70cd5988c3cab 100644 |
--- a/src/heap/remembered-set.h |
+++ b/src/heap/remembered-set.h |
@@ -239,86 +239,6 @@ class RememberedSet { |
static bool IsValidSlot(Heap* heap, MemoryChunk* chunk, Object** slot); |
}; |
-// Buffer for keeping thead local migration slots during compaction. |
-// TODO(ulan): Remove this once every thread gets local pages in compaction |
-// space. |
-class LocalSlotsBuffer BASE_EMBEDDED { |
- public: |
- LocalSlotsBuffer() : top_(new Node(nullptr)) {} |
- |
- ~LocalSlotsBuffer() { |
- Node* current = top_; |
- while (current != nullptr) { |
- Node* tmp = current->next; |
- delete current; |
- current = tmp; |
- } |
- } |
- |
- void Record(Address addr) { |
- EnsureSpaceFor(1); |
- uintptr_t entry = reinterpret_cast<uintptr_t>(addr); |
- DCHECK_GE(entry, static_cast<uintptr_t>(NUMBER_OF_SLOT_TYPES)); |
- Insert(entry); |
- } |
- |
- void Record(SlotType type, Address addr) { |
- EnsureSpaceFor(2); |
- Insert(static_cast<uintptr_t>(type)); |
- uintptr_t entry = reinterpret_cast<uintptr_t>(addr); |
- DCHECK_GE(entry, static_cast<uintptr_t>(NUMBER_OF_SLOT_TYPES)); |
- Insert(entry); |
- } |
- |
- template <typename UntypedCallback, typename TypedCallback> |
- void Iterate(UntypedCallback untyped_callback, TypedCallback typed_callback) { |
- Node* current = top_; |
- bool typed = false; |
- SlotType type; |
- Address addr; |
- while (current != nullptr) { |
- for (int i = 0; i < current->count; i++) { |
- uintptr_t entry = current->buffer[i]; |
- if (entry < NUMBER_OF_SLOT_TYPES) { |
- DCHECK(!typed); |
- typed = true; |
- type = static_cast<SlotType>(entry); |
- } else { |
- addr = reinterpret_cast<Address>(entry); |
- if (typed) { |
- typed_callback(type, addr); |
- typed = false; |
- } else { |
- untyped_callback(addr); |
- } |
- } |
- } |
- current = current->next; |
- } |
- } |
- |
- private: |
- void EnsureSpaceFor(int count) { |
- if (top_->remaining_free_slots() < count) top_ = new Node(top_); |
- } |
- |
- void Insert(uintptr_t entry) { top_->buffer[top_->count++] = entry; } |
- |
- static const int kBufferSize = 16 * KB; |
- |
- struct Node : Malloced { |
- explicit Node(Node* next_node) : next(next_node), count(0) {} |
- |
- inline int remaining_free_slots() { return kBufferSize - count; } |
- |
- Node* next; |
- uintptr_t buffer[kBufferSize]; |
- int count; |
- }; |
- |
- Node* top_; |
-}; |
- |
} // namespace internal |
} // namespace v8 |