[heap] De-duplicate insertions to the old-to-new remembered set.

Bug: v8:6663
Change-Id: I8bf7169c21141a34e3bcb0bb2193ceb1746b33b2
Reviewed-on: https://chromium-review.googlesource.com/600908
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47186}
This commit is contained in:
Ulan Degenbaev 2017-08-03 20:20:06 +02:00 committed by Commit Bot
parent cfb019f528
commit 35f9b26601

View File

@ -103,11 +103,13 @@ void StoreBuffer::MoveEntriesToRememberedSet(int index) {
if (!lazy_top_[index]) return;
DCHECK_GE(index, 0);
DCHECK_LT(index, kStoreBuffers);
Address last_inserted_addr = nullptr;
for (Address* current = start_[index]; current < lazy_top_[index];
current++) {
Address addr = *current;
Page* page = Page::FromAnyPointerAddress(heap_, addr);
if (IsDeletionAddress(addr)) {
last_inserted_addr = nullptr;
current++;
Address end = *current;
DCHECK(!IsDeletionAddress(end));
@ -120,7 +122,10 @@ void StoreBuffer::MoveEntriesToRememberedSet(int index) {
}
} else {
DCHECK(!IsDeletionAddress(addr));
RememberedSet<OLD_TO_NEW>::Insert(page, addr);
if (addr != last_inserted_addr) {
RememberedSet<OLD_TO_NEW>::Insert(page, addr);
last_inserted_addr = addr;
}
}
}
lazy_top_[index] = nullptr;