Commit e752660f authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Resolve data race in InAtomicMarkingPause

Incremental marking goes in and out of AtomicPauseScope during marking.
Checking InAtomicPause while concurrent marking can race with the
incremental marker exiting AtomicPauseScope.
Checking InAtomicMarkingPause only if !IsInIncrementalMarking checks
the same condition overall but concurrent markers won't need to check
InAtomicMarkingPause because IsInIncrementalMarking will always be true
while concurrent marking is active.

Bug: 986235
Change-Id: I6d21843b25db553dfcd0ae0e95ec3c43eaa99d49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893851Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711421}
parent 0b9a5a4f
......@@ -97,7 +97,7 @@ ALWAYS_INLINE void MarkingVisitorCommon::AccountMarkedBytes(
ALWAYS_INLINE bool MarkingVisitorCommon::MarkHeaderNoTracing(
HeapObjectHeader* header) {
DCHECK(header);
DCHECK(State()->InAtomicMarkingPause() || State()->IsIncrementalMarking());
DCHECK(State()->IsIncrementalMarking() || State()->InAtomicMarkingPause());
// A GC should only mark the objects that belong in its heap.
DCHECK_EQ(State(),
PageFromObject(header->Payload())->Arena()->GetThreadState());
......
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