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

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

Issue 1817523002: Speed up clearing of old to new slots in dead objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix compile 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/remembered-set.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/remembered-set.cc
diff --git a/src/heap/remembered-set.cc b/src/heap/remembered-set.cc
index 3ceca5551d7eb883d273f65457861e618727891c..403c99b05712ec53d2920b40e5ee6ff9e3a2f84c 100644
--- a/src/heap/remembered-set.cc
+++ b/src/heap/remembered-set.cc
@@ -22,9 +22,9 @@ void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) {
chunk = it.next();
SlotSet* slots = GetSlotSet(chunk);
if (slots != nullptr) {
- slots->Iterate([heap](Address addr) {
+ slots->Iterate([heap, chunk](Address addr) {
Object** slot = reinterpret_cast<Object**>(addr);
- return IsValidSlot(heap, slot) ? KEEP_SLOT : REMOVE_SLOT;
+ return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT;
});
}
}
@@ -54,7 +54,8 @@ void RememberedSet<direction>::VerifyValidSlots(Heap* heap) {
}
template <PointerDirection direction>
-bool RememberedSet<direction>::IsValidSlot(Heap* heap, Object** slot) {
+bool RememberedSet<direction>::IsValidSlot(Heap* heap, MemoryChunk* chunk,
+ Object** slot) {
STATIC_ASSERT(direction == OLD_TO_NEW);
Object* object = *slot;
if (!heap->InNewSpace(object)) {
@@ -64,8 +65,8 @@ bool RememberedSet<direction>::IsValidSlot(Heap* heap, Object** slot) {
// If the target object is not black, the source slot must be part
// of a non-black (dead) object.
return Marking::IsBlack(Marking::MarkBitFrom(heap_object)) &&
- heap->mark_compact_collector()->IsSlotInLiveObject(
- reinterpret_cast<Address>(slot));
+ heap->mark_compact_collector()->IsSlotInBlackObject(
+ chunk, reinterpret_cast<Address>(slot));
}
template void RememberedSet<OLD_TO_NEW>::ClearInvalidSlots(Heap* heap);
« no previous file with comments | « src/heap/remembered-set.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698