Commit 4a399719 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by V8 LUCI CQ

Reland "[heap] Skip weak heap objects when sharedness doesn't match"

This is a reland of commit 38767476

Changes since revert: None, original failure was caused by another CL

Original change's description:
> [heap] Skip weak heap objects when sharedness doesn't match
>
> During marking, shared objects should not be marked when not
> marking the shared heap (i.e. when not doing a shared GC).
> Doing so is unsafe, as marking can race with sweeper threads
> sweeping the shared heap. This CL adds the missing check on
> weak object marking.
>
> Bug: v8:12687
> Change-Id: I1e0b8ba6b09bbcf665e5ff0f6242ed88f543c1fa
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3583610
> Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
> Commit-Queue: Shu-yu Guo <syg@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#79964}

Bug: v8:12687
Change-Id: Ia24ff5daa4d37daf73391c0e577b086611c5e496
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3584600
Owners-Override: Shu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79971}
parent 9b79b2d7
......@@ -55,6 +55,7 @@ template <typename THeapObjectSlot>
void MarkingVisitorBase<ConcreteVisitor, MarkingState>::ProcessWeakHeapObject(
HeapObject host, THeapObjectSlot slot, HeapObject heap_object) {
concrete_visitor()->SynchronizePageAccess(heap_object);
if (!is_shared_heap_ && heap_object.InSharedHeap()) return;
if (concrete_visitor()->marking_state()->IsBlackOrGrey(heap_object)) {
// Weak references with live values are directly processed here to
// reduce the processing time of weak cells during the main GC
......
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