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

Unified Diff: src/heap/mark-compact.cc

Issue 1313383005: Clear SMI and non-evacuation candidate entries when filtering the slots buffer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index b5f191094c9b96f532aa3c9749eb48cf475d87d7..55e7b8e82b136b2e78d6583f0b0949ebbd714fd9 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -4522,9 +4522,18 @@ void SlotsBuffer::RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer) {
ObjectSlot slot = slots[slot_idx];
if (!IsTypedSlot(slot)) {
Object* object = *slot;
- if ((object->IsHeapObject() && heap->InNewSpace(object)) ||
+ // Slots are invalid when they currently:
+ // - do not point to a heap object (SMI)
+ // - point to a heap object in new space
+ // - are not within a live heap object on a valid pointer slot
+ // - point to a heap object not on an evacuation candidate
+ if (!object->IsHeapObject() || heap->InNewSpace(object) ||
!heap->mark_compact_collector()->IsSlotInLiveObject(
- reinterpret_cast<Address>(slot))) {
+ reinterpret_cast<Address>(slot)) ||
+ !Page::FromAddress(reinterpret_cast<Address>(object))
+ ->IsEvacuationCandidate()) {
+ // TODO(hpayer): Instead of replacing slots with kRemovedEntry we
+ // could shrink the slots buffer in-place.
slots[slot_idx] = kRemovedEntry;
}
} else {
@@ -4556,6 +4565,8 @@ void SlotsBuffer::RemoveObjectSlots(Heap* heap, SlotsBuffer* buffer,
if (!IsTypedSlot(slot)) {
Address slot_address = reinterpret_cast<Address>(slot);
if (slot_address >= start_slot && slot_address < end_slot) {
+ // TODO(hpayer): Instead of replacing slots with kRemovedEntry we
+ // could shrink the slots buffer in-place.
slots[slot_idx] = kRemovedEntry;
if (is_typed_slot) {
slots[slot_idx - 1] = kRemovedEntry;
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698