Commit ca3c6888 authored by Hannes Payer's avatar Hannes Payer

Fix concurrent sweeping in predictable mode and bring --concurrent-sweeping flag back.

BUG=
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/726363002

Cr-Commit-Position: refs/heads/master@{#25370}
parent cb73facc
...@@ -571,6 +571,7 @@ DEFINE_BOOL(age_code, true, ...@@ -571,6 +571,7 @@ DEFINE_BOOL(age_code, true,
"old code (required for code flushing)") "old code (required for code flushing)")
DEFINE_BOOL(incremental_marking, true, "use incremental marking") DEFINE_BOOL(incremental_marking, true, "use incremental marking")
DEFINE_BOOL(incremental_marking_steps, true, "do incremental marking steps") DEFINE_BOOL(incremental_marking_steps, true, "do incremental marking steps")
DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping")
DEFINE_BOOL(trace_incremental_marking, false, DEFINE_BOOL(trace_incremental_marking, false,
"trace progress of the incremental marking") "trace progress of the incremental marking")
DEFINE_BOOL(track_gc_object_stats, false, DEFINE_BOOL(track_gc_object_stats, false,
...@@ -706,6 +707,7 @@ DEFINE_BOOL(profile_hydrogen_code_stub_compilation, false, ...@@ -706,6 +707,7 @@ DEFINE_BOOL(profile_hydrogen_code_stub_compilation, false,
DEFINE_BOOL(predictable, false, "enable predictable mode") DEFINE_BOOL(predictable, false, "enable predictable mode")
DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation) DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation)
DEFINE_NEG_IMPLICATION(predictable, concurrent_osr) DEFINE_NEG_IMPLICATION(predictable, concurrent_osr)
DEFINE_NEG_IMPLICATION(predictable, concurrent_sweeping)
// //
......
...@@ -936,7 +936,8 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes, ...@@ -936,7 +936,8 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
if (state_ == SWEEPING) { if (state_ == SWEEPING) {
if (heap_->mark_compact_collector()->sweeping_in_progress() && if (heap_->mark_compact_collector()->sweeping_in_progress() &&
heap_->mark_compact_collector()->IsSweepingCompleted()) { (heap_->mark_compact_collector()->IsSweepingCompleted() ||
!FLAG_concurrent_sweeping)) {
heap_->mark_compact_collector()->EnsureSweepingCompleted(); heap_->mark_compact_collector()->EnsureSweepingCompleted();
} }
if (!heap_->mark_compact_collector()->sweeping_in_progress()) { if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
......
...@@ -470,12 +470,12 @@ void MarkCompactCollector::EnsureSweepingCompleted() { ...@@ -470,12 +470,12 @@ void MarkCompactCollector::EnsureSweepingCompleted() {
// If sweeping is not completed or not running at all, we try to complete it // If sweeping is not completed or not running at all, we try to complete it
// here. // here.
if (FLAG_predictable || !IsSweepingCompleted()) { if (!FLAG_concurrent_sweeping || !IsSweepingCompleted()) {
SweepInParallel(heap()->paged_space(OLD_DATA_SPACE), 0); SweepInParallel(heap()->paged_space(OLD_DATA_SPACE), 0);
SweepInParallel(heap()->paged_space(OLD_POINTER_SPACE), 0); SweepInParallel(heap()->paged_space(OLD_POINTER_SPACE), 0);
} }
// Wait twice for both jobs. // Wait twice for both jobs.
if (!FLAG_predictable) { if (FLAG_concurrent_sweeping) {
pending_sweeper_jobs_semaphore_.Wait(); pending_sweeper_jobs_semaphore_.Wait();
pending_sweeper_jobs_semaphore_.Wait(); pending_sweeper_jobs_semaphore_.Wait();
} }
...@@ -4145,7 +4145,7 @@ void MarkCompactCollector::SweepSpaces() { ...@@ -4145,7 +4145,7 @@ void MarkCompactCollector::SweepSpaces() {
SweepSpace(heap()->old_data_space(), CONCURRENT_SWEEPING); SweepSpace(heap()->old_data_space(), CONCURRENT_SWEEPING);
} }
sweeping_in_progress_ = true; sweeping_in_progress_ = true;
if (!FLAG_predictable) { if (FLAG_concurrent_sweeping) {
StartSweeperThreads(); StartSweeperThreads();
} }
} }
......
...@@ -2569,7 +2569,7 @@ void PagedSpace::PrepareForMarkCompact() { ...@@ -2569,7 +2569,7 @@ void PagedSpace::PrepareForMarkCompact() {
intptr_t PagedSpace::SizeOfObjects() { intptr_t PagedSpace::SizeOfObjects() {
DCHECK(FLAG_predictable || DCHECK(!FLAG_concurrent_sweeping ||
heap()->mark_compact_collector()->sweeping_in_progress() || heap()->mark_compact_collector()->sweeping_in_progress() ||
(unswept_free_bytes_ == 0)); (unswept_free_bytes_ == 0));
return Size() - unswept_free_bytes_ - (limit() - top()); return Size() - unswept_free_bytes_ - (limit() - top());
......
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