Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Unified Diff: src/heap/remembered-set.h

Issue 1811573002: [heap] Remove LocalStoreBuffer and add slots in parallel (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@new-flist
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/unittests/heap/remembered-set-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/heap/mark-compact.cc ('k') | test/unittests/heap/remembered-set-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698