Commit 502ce7e2 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Fix markbit data races with concurrent marker.

BUG=chromium:694255

Change-Id: I65b4ecc7630ece32e351c1c6acea3960f7b6778b
Reviewed-on: https://chromium-review.googlesource.com/541380Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46054}
parent b772ef4b
......@@ -3176,7 +3176,8 @@ void Heap::AdjustLiveBytes(HeapObject* object, int by) {
lo_space()->AdjustLiveBytes(by);
} else if (!in_heap_iterator() &&
!mark_compact_collector()->sweeping_in_progress() &&
ObjectMarking::IsBlack(object, MarkingState::Internal(object))) {
ObjectMarking::IsBlack<IncrementalMarking::kAtomicity>(
object, MarkingState::Internal(object))) {
DCHECK(MemoryChunk::FromAddress(object->address())->SweepingDone());
#ifdef V8_CONCURRENT_MARKING
MarkingState::Internal(object).IncrementLiveBytes<AccessMode::ATOMIC>(by);
......
......@@ -359,7 +359,8 @@ void StaticMarkingVisitor<StaticVisitor>::VisitWeakCell(Map* map,
// contain smi zero.
if (weak_cell->next_cleared() && !weak_cell->cleared()) {
HeapObject* value = HeapObject::cast(weak_cell->value());
if (ObjectMarking::IsBlackOrGrey(value, MarkingState::Internal(value))) {
if (ObjectMarking::IsBlackOrGrey<IncrementalMarking::kAtomicity>(
value, MarkingState::Internal(value))) {
// Weak cells with live values are directly processed here to reduce
// the processing time of weak cells during the main GC pause.
Object** slot = HeapObject::RawField(weak_cell, WeakCell::kValueOffset);
......
......@@ -1667,7 +1667,8 @@ void PagedSpace::Verify(ObjectVisitor* visitor) {
// All the interior pointers should be contained in the heap.
int size = object->Size();
object->IterateBody(map->instance_type(), size, visitor);
if (ObjectMarking::IsBlack(object, MarkingState::Internal(object))) {
if (ObjectMarking::IsBlack<IncrementalMarking::kAtomicity>(
object, MarkingState::Internal(object))) {
black_size += size;
}
......
......@@ -1519,7 +1519,8 @@ void WeakCell::initialize(HeapObject* val) {
// mark through a weak cell and collect evacuation candidates when we process
// all weak cells.
WriteBarrierMode mode =
ObjectMarking::IsBlack(this, MarkingState::Internal(this))
ObjectMarking::IsBlack<IncrementalMarking::kAtomicity>(
this, MarkingState::Internal(this))
? UPDATE_WRITE_BARRIER
: UPDATE_WEAK_WRITE_BARRIER;
CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kValueOffset, val, 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