Reviewers: jochen (slow),

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

BUG=

Please review this at https://codereview.chromium.org/726363002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+8, -5 lines):
  M src/flag-definitions.h
  M src/heap/incremental-marking.cc
  M src/heap/mark-compact.cc
  M src/heap/spaces.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index deaae06c6f6061da9e4dc65bd5dba60010d29b44..df24ea2a9ea1c3658730ed276cf6a1696d7760d7 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -571,6 +571,7 @@ DEFINE_BOOL(age_code, true,
             "old code (required for code flushing)")
 DEFINE_BOOL(incremental_marking, true, "use incremental marking")
DEFINE_BOOL(incremental_marking_steps, true, "do incremental marking steps")
+DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping")
 DEFINE_BOOL(trace_incremental_marking, false,
             "trace progress of the incremental marking")
 DEFINE_BOOL(track_gc_object_stats, false,
@@ -706,6 +707,7 @@ DEFINE_BOOL(profile_hydrogen_code_stub_compilation, false,
 DEFINE_BOOL(predictable, false, "enable predictable mode")
 DEFINE_NEG_IMPLICATION(predictable, concurrent_recompilation)
 DEFINE_NEG_IMPLICATION(predictable, concurrent_osr)
+DEFINE_NEG_IMPLICATION(predictable, concurrent_sweeping)


 //
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc index dde06217a2c035250df017790f2e72b01e8435de..9806b4edbdad193bbba387eda8336ff960193e07 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -936,7 +936,8 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,

     if (state_ == SWEEPING) {
       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();
       }
       if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 908b686c8813bf3c3ab4cadc18978919f9729ac6..a206b1d12e4beb525a4ffb2235e37ee9571ec830 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -470,12 +470,12 @@ void MarkCompactCollector::EnsureSweepingCompleted() {

// If sweeping is not completed or not running at all, we try to complete it
   // here.
-  if (FLAG_predictable || !IsSweepingCompleted()) {
+  if (!FLAG_concurrent_sweeping || !IsSweepingCompleted()) {
     SweepInParallel(heap()->paged_space(OLD_DATA_SPACE), 0);
     SweepInParallel(heap()->paged_space(OLD_POINTER_SPACE), 0);
   }
   // Wait twice for both jobs.
-  if (!FLAG_predictable) {
+  if (FLAG_concurrent_sweeping) {
     pending_sweeper_jobs_semaphore_.Wait();
     pending_sweeper_jobs_semaphore_.Wait();
   }
@@ -4145,7 +4145,7 @@ void MarkCompactCollector::SweepSpaces() {
       SweepSpace(heap()->old_data_space(), CONCURRENT_SWEEPING);
     }
     sweeping_in_progress_ = true;
-    if (!FLAG_predictable) {
+    if (FLAG_concurrent_sweeping) {
       StartSweeperThreads();
     }
   }
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 2b696ea8eb5238f91f5ade5702cc663f4c09cc73..30b141fcd32965637bd6ed1a2cc29284dff33750 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -2569,7 +2569,7 @@ void PagedSpace::PrepareForMarkCompact() {


 intptr_t PagedSpace::SizeOfObjects() {
-  DCHECK(FLAG_predictable ||
+  DCHECK(!FLAG_concurrent_sweeping ||
          heap()->mark_compact_collector()->sweeping_in_progress() ||
          (unswept_free_bytes_ == 0));
   return Size() - unswept_free_bytes_ - (limit() - top());


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to