Commit 35f9b266 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

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

Bug: v8:6663
Change-Id: I8bf7169c21141a34e3bcb0bb2193ceb1746b33b2
Reviewed-on: https://chromium-review.googlesource.com/600908Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47186}
parent cfb019f5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment