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() { ...@@ -5965,15 +5965,16 @@ bool Heap::SetUp() {
mark_compact_collector_ = new MarkCompactCollector(this); mark_compact_collector_ = new MarkCompactCollector(this);
incremental_marking_->set_marking_worklist( incremental_marking_->set_marking_worklist(
mark_compact_collector_->marking_worklist()); mark_compact_collector_->marking_worklist());
#ifdef V8_CONCURRENT_MARKING if (FLAG_concurrent_marking) {
MarkCompactCollector::MarkingWorklist* marking_worklist = MarkCompactCollector::MarkingWorklist* marking_worklist =
mark_compact_collector_->marking_worklist(); mark_compact_collector_->marking_worklist();
concurrent_marking_ = new ConcurrentMarking( concurrent_marking_ = new ConcurrentMarking(
this, marking_worklist->shared(), marking_worklist->bailout(), this, marking_worklist->shared(), marking_worklist->bailout(),
mark_compact_collector_->weak_cells()); mark_compact_collector_->weak_cells());
#else } else {
concurrent_marking_ = new ConcurrentMarking(this, nullptr, nullptr, nullptr); concurrent_marking_ =
#endif new ConcurrentMarking(this, nullptr, nullptr, nullptr);
}
minor_mark_compact_collector_ = new MinorMarkCompactCollector(this); minor_mark_compact_collector_ = new MinorMarkCompactCollector(this);
gc_idle_time_handler_ = new GCIdleTimeHandler(); gc_idle_time_handler_ = new GCIdleTimeHandler();
memory_reducer_ = new MemoryReducer(this); memory_reducer_ = new MemoryReducer(this);
......
...@@ -123,13 +123,12 @@ void IncrementalMarking::MarkBlackAndPush(HeapObject* obj) { ...@@ -123,13 +123,12 @@ void IncrementalMarking::MarkBlackAndPush(HeapObject* obj) {
// Color the object black and push it into the bailout deque. // Color the object black and push it into the bailout deque.
ObjectMarking::WhiteToGrey<kAtomicity>(obj, marking_state(obj)); ObjectMarking::WhiteToGrey<kAtomicity>(obj, marking_state(obj));
if (ObjectMarking::GreyToBlack<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); marking_worklist()->PushBailout(obj);
#else } else if (!marking_worklist()->Push(obj)) {
if (!marking_worklist()->Push(obj)) { ObjectMarking::BlackToGrey<AccessMode::NON_ATOMIC>(obj,
ObjectMarking::BlackToGrey<kAtomicity>(obj, marking_state(obj)); marking_state(obj));
} }
#endif
} }
} }
...@@ -219,9 +218,9 @@ class IncrementalMarkingMarkingVisitor final ...@@ -219,9 +218,9 @@ class IncrementalMarkingMarkingVisitor final
int start_offset = int start_offset =
Max(FixedArray::BodyDescriptor::kStartOffset, chunk->progress_bar()); Max(FixedArray::BodyDescriptor::kStartOffset, chunk->progress_bar());
if (start_offset < object_size) { if (start_offset < object_size) {
#ifdef V8_CONCURRENT_MARKING if (FLAG_concurrent_marking) {
incremental_marking_->marking_worklist()->PushBailout(object); incremental_marking_->marking_worklist()->PushBailout(object);
#else } else {
if (ObjectMarking::IsGrey<IncrementalMarking::kAtomicity>( if (ObjectMarking::IsGrey<IncrementalMarking::kAtomicity>(
object, incremental_marking_->marking_state(object))) { object, incremental_marking_->marking_state(object))) {
incremental_marking_->marking_worklist()->Push(object); incremental_marking_->marking_worklist()->Push(object);
...@@ -230,7 +229,7 @@ class IncrementalMarkingMarkingVisitor final ...@@ -230,7 +229,7 @@ class IncrementalMarkingMarkingVisitor final
object, incremental_marking_->marking_state(object))); object, incremental_marking_->marking_state(object)));
collector_->PushBlack(object); collector_->PushBlack(object);
} }
#endif }
int end_offset = int end_offset =
Min(object_size, start_offset + kProgressBarScanningChunk); Min(object_size, start_offset + kProgressBarScanningChunk);
int already_scanned_offset = start_offset; 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