Commit 3e5db487 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Move RecordSlot to concurrent marking

Move Slot recording to concurrent and incremental marking phase and
out of the atomic pause. Records more slots to remove
slot recording completely from the pause.

Bug: chromium:844008
Change-Id: I13ba20b4839990134dc37bd909fb0a2d66e13c64
Reviewed-on: https://chromium-review.googlesource.com/1104348
Commit-Queue: Dominik Inführ <dinfuehr@google.com>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53804}
parent 3cb376dc
...@@ -362,12 +362,24 @@ class ConcurrentMarkingVisitor final ...@@ -362,12 +362,24 @@ class ConcurrentMarkingVisitor final
weak_objects_->ephemeron_hash_tables.Push(task_id_, table); weak_objects_->ephemeron_hash_tables.Push(task_id_, table);
for (int i = 0; i < table->Capacity(); i++) { for (int i = 0; i < table->Capacity(); i++) {
Object** key_slot =
table->RawFieldOfElementAt(EphemeronHashTable::EntryToIndex(i));
HeapObject* key = HeapObject::cast(table->KeyAt(i)); HeapObject* key = HeapObject::cast(table->KeyAt(i));
MarkCompactCollector::RecordSlot(table, key_slot, key);
Object** value_slot =
table->RawFieldOfElementAt(EphemeronHashTable::EntryToValueIndex(i));
if (marking_state_.IsBlackOrGrey(key)) { if (marking_state_.IsBlackOrGrey(key)) {
Object** value_slot = table->RawFieldOfElementAt(
EphemeronHashTable::EntryToValueIndex(i));
VisitPointer(table, value_slot); VisitPointer(table, value_slot);
} else {
Object* value = table->ValueAt(i);
if (value->IsHeapObject()) {
MarkCompactCollector::RecordSlot(table, value_slot,
HeapObject::cast(value));
}
} }
} }
......
...@@ -93,11 +93,23 @@ int MarkingVisitor<fixed_array_mode, retaining_path_mode, MarkingState>:: ...@@ -93,11 +93,23 @@ int MarkingVisitor<fixed_array_mode, retaining_path_mode, MarkingState>::
collector_->AddEphemeronHashTable(table); collector_->AddEphemeronHashTable(table);
for (int i = 0; i < table->Capacity(); i++) { for (int i = 0; i < table->Capacity(); i++) {
Object** key_slot =
table->RawFieldOfElementAt(EphemeronHashTable::EntryToIndex(i));
HeapObject* key = HeapObject::cast(table->KeyAt(i)); HeapObject* key = HeapObject::cast(table->KeyAt(i));
if (marking_state()->IsBlackOrGrey(key)) { collector_->RecordSlot(table, key_slot, key);
Object** value_slot = Object** value_slot =
table->RawFieldOfElementAt(EphemeronHashTable::EntryToValueIndex(i)); table->RawFieldOfElementAt(EphemeronHashTable::EntryToValueIndex(i));
if (marking_state()->IsBlackOrGrey(key)) {
VisitPointer(table, value_slot); VisitPointer(table, value_slot);
} else {
Object* value = *value_slot;
if (value->IsHeapObject()) {
collector_->RecordSlot(table, value_slot, HeapObject::cast(value));
}
} }
} }
......
...@@ -1910,16 +1910,10 @@ class EphemeronHashTableMarkingTask : public ItemParallelJob::Task { ...@@ -1910,16 +1910,10 @@ class EphemeronHashTableMarkingTask : public ItemParallelJob::Task {
for (int i = start; i < limit; i++) { for (int i = start; i < limit; i++) {
HeapObject* key = HeapObject::cast(table->KeyAt(i)); HeapObject* key = HeapObject::cast(table->KeyAt(i));
if (collector_->marking_state()->IsBlackOrGrey(key)) { if (collector_->marking_state()->IsBlackOrGrey(key)) {
Object** key_slot = Object* value_obj = table->ValueAt(i);
table->RawFieldOfElementAt(EphemeronHashTable::EntryToIndex(i));
collector_->RecordSlot(table, key_slot, key);
Object** value_slot = table->RawFieldOfElementAt(
EphemeronHashTable::EntryToValueIndex(i));
Object* value_obj = *value_slot;
if (value_obj->IsHeapObject()) { if (value_obj->IsHeapObject()) {
HeapObject* value = HeapObject::cast(value_obj); HeapObject* value = HeapObject::cast(value_obj);
collector_->RecordSlot(table, value_slot, value);
if (collector_->marking_state()->WhiteToGrey(value)) { if (collector_->marking_state()->WhiteToGrey(value)) {
worklist_->Push(task_id_, value); worklist_->Push(task_id_, value);
......
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