heap: Fix --minor-mc ephemeron processing
Minor MC does not support processing the specialized remembered set for ephemeron tables. Temporarily delegate to the regular write barrier for correctness until the other barrier is supported. Bug: v8:12262 Change-Id: Iad74b27f8738237dcc1e146b2df3aa6ed8c9a505 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3195895 Reviewed-by: Dominik Inführ <dinfuehr@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/main@{#77170}
This commit is contained in:
parent
2ae6cda1ee
commit
46088a2838
@ -7087,11 +7087,18 @@ void Heap::GenerationalBarrierSlow(HeapObject object, Address slot,
|
||||
|
||||
void Heap::RecordEphemeronKeyWrite(EphemeronHashTable table, Address slot) {
|
||||
DCHECK(ObjectInYoungGeneration(HeapObjectSlot(slot).ToHeapObject()));
|
||||
if (FLAG_minor_mc) {
|
||||
// Minor MC lacks support for specialized generational ephemeron barriers.
|
||||
// The regular write barrier works as well but keeps more memory alive.
|
||||
MemoryChunk* chunk = MemoryChunk::FromHeapObject(table);
|
||||
RememberedSet<OLD_TO_NEW>::Insert<AccessMode::NON_ATOMIC>(chunk, slot);
|
||||
} else {
|
||||
int slot_index = EphemeronHashTable::SlotToIndex(table.address(), slot);
|
||||
InternalIndex entry = EphemeronHashTable::IndexToEntry(slot_index);
|
||||
auto it =
|
||||
ephemeron_remembered_set_.insert({table, std::unordered_set<int>()});
|
||||
it.first->second.insert(entry.as_int());
|
||||
}
|
||||
}
|
||||
|
||||
void Heap::EphemeronKeyWriteBarrierFromCode(Address raw_object,
|
||||
|
@ -4797,6 +4797,9 @@ class MinorMarkCompactCollector::RootMarkingVisitor : public RootVisitor {
|
||||
};
|
||||
|
||||
void MinorMarkCompactCollector::CollectGarbage() {
|
||||
// Minor MC does not support processing the ephemeron remembered set.
|
||||
DCHECK(heap()->ephemeron_remembered_set_.empty());
|
||||
|
||||
{
|
||||
TRACE_GC(heap()->tracer(), GCTracer::Scope::MINOR_MC_SWEEPING);
|
||||
heap()->mark_compact_collector()->sweeper()->EnsureIterabilityCompleted();
|
||||
|
Loading…
Reference in New Issue
Block a user