Reviewers: Hannes Payer,

Message:
PTAL

Description:
Allow compaction when incremental marking is on.

BUG=chromium:450824
LOG=NO

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

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

Affected files (+8, -12 lines):
  M src/heap/incremental-marking.h
  M src/heap/incremental-marking.cc


Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc index 56cd688446ba92f3d568b60164bcc91bb612dade..f2ce5e155f5f80c1b92fa91724d6d11ac0ede04f 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -459,7 +459,7 @@ static void PatchIncrementalMarkingRecordWriteStubs(
 }


-void IncrementalMarking::Start(CompactionFlag flag) {
+void IncrementalMarking::Start() {
   if (FLAG_trace_incremental_marking) {
     PrintF("[IncrementalMarking] Start\n");
   }
@@ -474,7 +474,7 @@ void IncrementalMarking::Start(CompactionFlag flag) {
   was_activated_ = true;

   if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
-    StartMarking(flag);
+    StartMarking();
   } else {
     if (FLAG_trace_incremental_marking) {
       PrintF("[IncrementalMarking] Start sweeping.\n");
@@ -486,12 +486,12 @@ void IncrementalMarking::Start(CompactionFlag flag) {
 }


-void IncrementalMarking::StartMarking(CompactionFlag flag) {
+void IncrementalMarking::StartMarking() {
   if (FLAG_trace_incremental_marking) {
     PrintF("[IncrementalMarking] Start marking\n");
   }

-  is_compacting_ = !FLAG_never_compact && (flag == ALLOW_COMPACTION) &&
+  is_compacting_ = !FLAG_never_compact &&
                    heap_->mark_compact_collector()->StartCompaction(
                        MarkCompactCollector::INCREMENTAL_COMPACTION);

@@ -823,9 +823,7 @@ void IncrementalMarking::Epilogue() {

 void IncrementalMarking::OldSpaceStep(intptr_t allocated) {
   if (IsStopped() && ShouldActivate()) {
-    // TODO(hpayer): Let's play safe for now, but compaction should be
-    // in principle possible.
-    Start(PREVENT_COMPACTION);
+    Start();
   } else {
Step(allocated * kFastMarking / kInitialMarkingSpeed, GC_VIA_STACK_GUARD);
   }
@@ -954,7 +952,7 @@ intptr_t IncrementalMarking::Step(intptr_t allocated_bytes,
       }
       if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
         bytes_scanned_ = 0;
-        StartMarking(PREVENT_COMPACTION);
+        StartMarking();
       }
     } else if (state_ == MARKING) {
       bytes_processed = ProcessMarkingDeque(bytes_to_process);
Index: src/heap/incremental-marking.h
diff --git a/src/heap/incremental-marking.h b/src/heap/incremental-marking.h
index 8ad12bc79f95065c3c30efbc1f0389e35135ce22..4bcb1b433e65e01ad4372b2216cf57950e738f17 100644
--- a/src/heap/incremental-marking.h
+++ b/src/heap/incremental-marking.h
@@ -62,9 +62,7 @@ class IncrementalMarking {

   bool WasActivated();

-  enum CompactionFlag { ALLOW_COMPACTION, PREVENT_COMPACTION };
-
-  void Start(CompactionFlag flag = ALLOW_COMPACTION);
+  void Start();

   void Stop();

@@ -203,7 +201,7 @@ class IncrementalMarking {

   void ResetStepCounters();

-  void StartMarking(CompactionFlag flag);
+  void StartMarking();

   void ActivateIncrementalWriteBarrier(PagedSpace* space);
   static void ActivateIncrementalWriteBarrier(NewSpace* space);


--
--
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