Commit ddafb7a3 authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[heap] Verify client heaps during shared GC

With --verify-heap verify all client heaps before and after a shared
GC. This ensures that the OLD_TO_SHARED remembered set is properly
filled for each client isolate.

Bug: v8:11708
Change-Id: I1506a419c7a91c5baa87ce251da9861d8ad9e066
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3857559Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82829}
parent 67c0ad3b
......@@ -2434,12 +2434,30 @@ void Heap::PerformSharedGarbageCollection(Isolate* initiator,
if (FLAG_concurrent_marking) {
client->heap()->concurrent_marking()->Pause();
}
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
// We don't really perform a GC here but need this scope for the nested
// SafepointScope inside Verify().
AllowGarbageCollection allow_gc;
HeapVerifier::VerifyHeap(client->heap());
}
#endif // VERIFY_HEAP
});
const GarbageCollector collector = GarbageCollector::MARK_COMPACTOR;
PerformGarbageCollection(collector, gc_reason, nullptr);
isolate()->global_safepoint()->IterateClientIsolates([](Isolate* client) {
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
// We don't really perform a GC here but need this scope for the nested
// SafepointScope inside Verify().
AllowGarbageCollection allow_gc;
HeapVerifier::VerifyHeap(client->heap());
}
#endif // VERIFY_HEAP
if (FLAG_concurrent_marking &&
client->heap()->incremental_marking()->IsMarking()) {
client->heap()->concurrent_marking()->RescheduleJobIfNeeded();
......
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