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

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

Issue 2440683002: [heap] Move typed slot filtering logic into sweeper. (Closed)
Patch Set: fix test Created 4 years, 2 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/remembered-set.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/slot-set.h
diff --git a/src/heap/slot-set.h b/src/heap/slot-set.h
index eb2fbb9e5b2773df435a1a70993fd8954ed04bca..da61052b8a68f1554e1822af7df3c48ff1eeda5d 100644
--- a/src/heap/slot-set.h
+++ b/src/heap/slot-set.h
@@ -5,6 +5,7 @@
#ifndef V8_SLOT_SET_H
#define V8_SLOT_SET_H
+#include <map>
#include <stack>
#include "src/allocation.h"
@@ -460,6 +461,28 @@ class TypedSlotSet {
}
}
+ void RemoveInvaldSlots(std::map<uint32_t, uint32_t>& invalid_ranges) {
+ Chunk* chunk = chunk_.Value();
+ while (chunk != nullptr) {
+ TypedSlot* buffer = chunk->buffer.Value();
+ int count = chunk->count.Value();
+ for (int i = 0; i < count; i++) {
+ uint32_t host_offset = buffer[i].host_offset();
+ std::map<uint32_t, uint32_t>::iterator upper_bound =
+ invalid_ranges.upper_bound(host_offset);
+ if (upper_bound == invalid_ranges.begin()) continue;
+ // upper_bounds points to the invalid range after the given slot. Hence,
+ // we have to go to the previous element.
+ upper_bound--;
+ DCHECK_LE(upper_bound->first, host_offset);
+ if (upper_bound->second > host_offset) {
+ buffer[i].Clear();
+ }
+ }
+ chunk = chunk->next.Value();
+ }
+ }
+
private:
static const int kInitialBufferSize = 100;
static const int kMaxBufferSize = 16 * KB;
« no previous file with comments | « src/heap/remembered-set.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698