Revert "[heap] Disable old-to-new invalidation"

This reverts commit ac3c4fcfab.

Reason for revert: Tested this CL for backport.

Original change's description:
> [heap] Disable old-to-new invalidation
> 
> Disable invalidation of old-to-new slots for now. Invalidation doesn't
> match behavior of clearing slots directly in the remembered set.
> 
> Bug: chromium:1004365
> Change-Id: Ib6a21457827faafa75be88720c214e5ec483c71b
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1813028
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#63890}

TBR=ulan@chromium.org,dinfuehr@chromium.org

Change-Id: Id3d210cd970ea7b8e28571b7801b7a395e4f0af3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1004365
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1813745
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63891}
This commit is contained in:
Dominik Inführ 2019-09-19 13:30:17 +00:00 committed by Commit Bot
parent ac3c4fcfab
commit ce304db8dc
4 changed files with 21 additions and 2 deletions

View File

@ -3406,6 +3406,11 @@ void Heap::NotifyObjectLayoutChange(
->RegisterObjectWithInvalidatedSlots<OLD_TO_OLD>(object);
}
}
if (invalidate_recorded_slots == InvalidateRecordedSlots::kYes &&
MayContainRecordedSlots(object)) {
MemoryChunk::FromHeapObject(object)
->RegisterObjectWithInvalidatedSlots<OLD_TO_NEW>(object);
}
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
DCHECK(pending_layout_change_object_.is_null());

View File

@ -3428,7 +3428,11 @@ class RememberedSetUpdatingItem : public UpdatingItem {
SlotSet::PREFREE_EMPTY_BUCKETS);
}
DCHECK_NULL(chunk_->invalidated_slots<OLD_TO_NEW>());
if (chunk_->invalidated_slots<OLD_TO_NEW>() != nullptr) {
// The invalidated slots are not needed after old-to-new slots were
// processed.
chunk_->ReleaseInvalidatedSlots<OLD_TO_NEW>();
}
if ((updating_mode_ == RememberedSetUpdatingMode::ALL) &&
(chunk_->slot_set<OLD_TO_OLD, AccessMode::NON_ATOMIC>() != nullptr)) {

View File

@ -458,7 +458,11 @@ void Scavenger::ScavengePage(MemoryChunk* page) {
},
SlotSet::KEEP_EMPTY_BUCKETS);
DCHECK_NULL(page->invalidated_slots<OLD_TO_NEW>());
if (page->invalidated_slots<OLD_TO_NEW>() != nullptr) {
// The invalidated slots are not needed after old-to-new slots were
// processed.
page->ReleaseInvalidatedSlots<OLD_TO_NEW>();
}
RememberedSet<OLD_TO_NEW>::IterateTyped(
page, [=](SlotType type, Address addr) {

View File

@ -1555,6 +1555,12 @@ void MemoryChunk::InvalidateRecordedSlots(HeapObject object) {
// concurrent markers might insert slots concurrently.
RegisterObjectWithInvalidatedSlots<OLD_TO_OLD>(object);
}
heap()->MoveStoreBufferEntriesToRememberedSet();
if (slot_set_[OLD_TO_NEW] != nullptr) {
RegisterObjectWithInvalidatedSlots<OLD_TO_NEW>(object);
}
}
template bool MemoryChunk::RegisteredObjectWithInvalidatedSlots<OLD_TO_NEW>(