Commit bdc108ea authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Fix Heap::MoveElements for concurrent marker.

BUG=chromium:694255

Change-Id: I1e8104831a9d31177bfaffc2a99300e2022edfd3
Reviewed-on: https://chromium-review.googlesource.com/544918Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46126}
parent 4a635150
......@@ -1130,10 +1130,17 @@ void Heap::MoveElements(FixedArray* array, int dst_index, int src_index,
Object** dst = array->data_start() + dst_index;
Object** src = array->data_start() + src_index;
if (FLAG_concurrent_marking && concurrent_marking()->IsTaskPending()) {
if (dst < src) {
for (int i = 0; i < len; i++) {
base::AsAtomicWord::Relaxed_Store(
dst + i, base::AsAtomicWord::Relaxed_Load(src + i));
}
} else {
for (int i = len - 1; i >= 0; i--) {
base::AsAtomicWord::Relaxed_Store(
dst + i, base::AsAtomicWord::Relaxed_Load(src + i));
}
}
} else {
MemMove(dst, src, len * kPointerSize);
}
......@@ -3305,7 +3312,8 @@ void Heap::RightTrimFixedArray(FixedArrayBase* object, int elements_to_trim) {
// Clear the mark bits of the black area that belongs now to the filler.
// This is an optimization. The sweeper will release black fillers anyway.
if (incremental_marking()->black_allocation() &&
ObjectMarking::IsBlackOrGrey(filler, MarkingState::Internal(filler))) {
ObjectMarking::IsBlackOrGrey<IncrementalMarking::kAtomicity>(
filler, MarkingState::Internal(filler))) {
Page* page = Page::FromAddress(new_end);
MarkingState::Internal(page).bitmap()->ClearRange(
page->AddressToMarkbitIndex(new_end),
......
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