Commit c0c7b0c3 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Fix benign race in DCHECKs for mark bits

During minor MC new space evacuation we could have two adjacent LABs
sharing a mark bit cell. The DCHECK when observing and changing markbits
of the target needs to reflect that.

Bug: chromium:651354
Change-Id: I737d0f9e3d37dfb1cda3f126d37ed5e7123bedc9
Reviewed-on: https://chromium-review.googlesource.com/541296Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46032}
parent cd2cc62e
......@@ -1585,7 +1585,7 @@ class YoungGenerationMigrationObserver final : public MigrationObserver {
// Migrate color to old generation marking in case the object survived young
// generation garbage collection.
if (heap_->incremental_marking()->IsMarking()) {
DCHECK(ObjectMarking::IsWhite(
DCHECK(ObjectMarking::IsWhite<AccessMode::ATOMIC>(
dst, mark_compact_collector_->marking_state(dst)));
heap_->incremental_marking()->TransferColor<AccessMode::ATOMIC>(src, dst);
}
......
......@@ -237,7 +237,7 @@ class Marking : public AllStatic {
static const char* kWhiteBitPattern;
template <AccessMode mode = AccessMode::NON_ATOMIC>
INLINE(static bool IsWhite(MarkBit mark_bit)) {
DCHECK(!IsImpossible(mark_bit));
DCHECK(!IsImpossible<mode>(mark_bit));
return !mark_bit.Get<mode>();
}
......
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