Commit 4598d17a authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Replace compile time flag with runtime flag for parts of

concurrent marker.

Bug: chromium:694255
Change-Id: I973ba8df7a4afc5f58ede02f3f6d043cf7038784
Reviewed-on: https://chromium-review.googlesource.com/600970Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47153}
parent 9dc7201c
......@@ -5965,15 +5965,16 @@ bool Heap::SetUp() {
mark_compact_collector_ = new MarkCompactCollector(this);
incremental_marking_->set_marking_worklist(
mark_compact_collector_->marking_worklist());
#ifdef V8_CONCURRENT_MARKING
if (FLAG_concurrent_marking) {
MarkCompactCollector::MarkingWorklist* marking_worklist =
mark_compact_collector_->marking_worklist();
concurrent_marking_ = new ConcurrentMarking(
this, marking_worklist->shared(), marking_worklist->bailout(),
mark_compact_collector_->weak_cells());
#else
concurrent_marking_ = new ConcurrentMarking(this, nullptr, nullptr, nullptr);
#endif
} else {
concurrent_marking_ =
new ConcurrentMarking(this, nullptr, nullptr, nullptr);
}
minor_mark_compact_collector_ = new MinorMarkCompactCollector(this);
gc_idle_time_handler_ = new GCIdleTimeHandler();
memory_reducer_ = new MemoryReducer(this);
......
......@@ -123,13 +123,12 @@ void IncrementalMarking::MarkBlackAndPush(HeapObject* obj) {
// Color the object black and push it into the bailout deque.
ObjectMarking::WhiteToGrey<kAtomicity>(obj, marking_state(obj));
if (ObjectMarking::GreyToBlack<kAtomicity>(obj, marking_state(obj))) {
#ifdef V8_CONCURRENT_MARKING
if (FLAG_concurrent_marking) {
marking_worklist()->PushBailout(obj);
#else
if (!marking_worklist()->Push(obj)) {
ObjectMarking::BlackToGrey<kAtomicity>(obj, marking_state(obj));
} else if (!marking_worklist()->Push(obj)) {
ObjectMarking::BlackToGrey<AccessMode::NON_ATOMIC>(obj,
marking_state(obj));
}
#endif
}
}
......@@ -219,9 +218,9 @@ class IncrementalMarkingMarkingVisitor final
int start_offset =
Max(FixedArray::BodyDescriptor::kStartOffset, chunk->progress_bar());
if (start_offset < object_size) {
#ifdef V8_CONCURRENT_MARKING
if (FLAG_concurrent_marking) {
incremental_marking_->marking_worklist()->PushBailout(object);
#else
} else {
if (ObjectMarking::IsGrey<IncrementalMarking::kAtomicity>(
object, incremental_marking_->marking_state(object))) {
incremental_marking_->marking_worklist()->Push(object);
......@@ -230,7 +229,7 @@ class IncrementalMarkingMarkingVisitor final
object, incremental_marking_->marking_state(object)));
collector_->PushBlack(object);
}
#endif
}
int end_offset =
Min(object_size, start_offset + kProgressBarScanningChunk);
int already_scanned_offset = start_offset;
......
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