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

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

Issue 1420423009: [heap] Black allocation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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
Index: src/heap/remembered-set.cc
diff --git a/src/heap/remembered-set.cc b/src/heap/remembered-set.cc
index f41318c312fbb1be2ba2ad369c4ed77b252280e1..d1d8a33bc377c3ce26dbec2476837e60a6d6e31b 100644
--- a/src/heap/remembered-set.cc
+++ b/src/heap/remembered-set.cc
@@ -33,21 +33,23 @@ void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) {
template <PointerDirection direction>
void RememberedSet<direction>::VerifyValidSlots(Heap* heap) {
Iterate(heap, [heap](Address addr) {
- HeapObject* obj =
- heap->mark_compact_collector()->FindBlackObjectBySlotSlow(addr);
- if (obj == nullptr) {
- // The slot is in dead object.
- MemoryChunk* chunk = MemoryChunk::FromAnyPointerAddress(heap, addr);
- AllocationSpace owner = chunk->owner()->identity();
- // The old to old remembered set should not have dead slots.
- CHECK_NE(direction, OLD_TO_OLD);
- // The old to new remembered set is allowed to have slots in dead
- // objects only in map and large object space because these spaces cannot
- // have raw untaged pointers.
- CHECK(owner == MAP_SPACE || owner == LO_SPACE);
- } else {
- int offset = static_cast<int>(addr - obj->address());
- CHECK(obj->IsValidSlot(offset));
+ if (!Page::FromAddress(addr)->IsFlagSet(Page::BLACK_PAGE)) {
+ HeapObject* obj =
+ heap->mark_compact_collector()->FindBlackObjectBySlotSlow(addr);
+ if (obj == nullptr) {
+ // The slot is in dead object.
+ MemoryChunk* chunk = MemoryChunk::FromAnyPointerAddress(heap, addr);
+ AllocationSpace owner = chunk->owner()->identity();
+ // The old to old remembered set should not have dead slots.
+ CHECK_NE(direction, OLD_TO_OLD);
+ // The old to new remembered set is allowed to have slots in dead
+ // objects only in map and large object space because these space
+ // cannot have raw untagged pointers.
+ CHECK(owner == MAP_SPACE || owner == LO_SPACE);
+ } else {
+ int offset = static_cast<int>(addr - obj->address());
+ CHECK(obj->IsValidSlot(offset));
+ }
}
return KEEP_SLOT;
});

Powered by Google App Engine
This is Rietveld 408576698