Reviewers: Hannes Payer,

Message:
PTAL

Description:
Pass GC flags to incremental marker and start incremental marking with
reduce memory footprint in idle notification.

BUG=

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

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

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


Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index df12e79beaaf030d3d1039d079f701d461c8dec4..0a050844d696fc84825ae432d3464b43d7337313 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4650,8 +4650,8 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
       break;
     case DO_INCREMENTAL_MARKING: {
       if (incremental_marking()->IsStopped()) {
-        // TODO(ulan): take reduce_memory into account.
-        incremental_marking()->Start();
+        incremental_marking()->Start(
+ action.reduce_memory ? kReduceMemoryFootprintMask : kNoGCFlags);
       }
       double remaining_idle_time_in_ms = 0.0;
       do {
Index: src/heap/incremental-marking.cc
diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc index 95f522bd991fe83fadb9baa8445fd7768b736f6f..8b007be81b16ea05927e90ee2a29c87ab5b2ef4c 100644
--- a/src/heap/incremental-marking.cc
+++ b/src/heap/incremental-marking.cc
@@ -467,7 +467,7 @@ static void PatchIncrementalMarkingRecordWriteStubs(
 }


-void IncrementalMarking::Start() {
+void IncrementalMarking::Start(int flags_for_mark_compact_collector) {
   if (FLAG_trace_incremental_marking) {
     PrintF("[IncrementalMarking] Start\n");
   }
@@ -482,7 +482,9 @@ void IncrementalMarking::Start() {
   was_activated_ = true;

   if (!heap_->mark_compact_collector()->sweeping_in_progress()) {
+ heap_->mark_compact_collector()->SetFlags(flags_for_mark_compact_collector);
     StartMarking();
+    heap_->mark_compact_collector()->SetFlags(Heap::kNoGCFlags);
   } else {
     if (FLAG_trace_incremental_marking) {
       PrintF("[IncrementalMarking] Start sweeping.\n");
Index: src/heap/incremental-marking.h
diff --git a/src/heap/incremental-marking.h b/src/heap/incremental-marking.h
index 7668def6795323d2497068b7ffcd7c5cfba1c91d..9b3c8beb2fdd4359afff8622897aac0545727c71 100644
--- a/src/heap/incremental-marking.h
+++ b/src/heap/incremental-marking.h
@@ -67,7 +67,7 @@ class IncrementalMarking {

   bool WasActivated();

-  void Start();
+  void Start(int flags_for_mark_compact_collector);

   void Stop();



--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to