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

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

Issue 2440683002: [heap] Move typed slot filtering logic into sweeper. (Closed)
Patch Set: format 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
Index: src/heap/slot-set.h
diff --git a/src/heap/slot-set.h b/src/heap/slot-set.h
index eb2fbb9e5b2773df435a1a70993fd8954ed04bca..4bfc65bd1d231c2dcaa059cca9b2b25483d8b743 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,27 @@ 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);
ulan 2016/10/20 15:48:19 if (upper_bound == invalid_ranges.begin()) continu
Hannes Payer (out of office) 2016/10/21 07:13:30 Done.
+ // upper_bounds points to the invalid range after the given slot. Hence,
+ // we have to go to the previous element.
+ upper_bound--;
+ if (upper_bound->first <= host_offset &&
ulan 2016/10/20 15:48:19 DCHECK_LE(upper_bound->first, host_offset); This s
Hannes Payer (out of office) 2016/10/21 07:13:29 Done.
+ upper_bound->second > host_offset) {
+ buffer[i].Clear();
+ }
+ }
+ chunk = chunk->next.Value();
+ }
+ }
+
private:
static const int kInitialBufferSize = 100;
static const int kMaxBufferSize = 16 * KB;
« src/heap/mark-compact.cc ('K') | « 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