Reviewers: Hannes Payer,

Message:
PTAL

Description:
Make more GCs in idle notification handler.

When counting GCs in idle round, count only GC that were directly triggered by
the idle notification handler.

[email protected]
BUG=241815

Please review this at https://chromiumcodereview.appspot.com/15737007/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/heap.h
  M src/heap.cc


Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 98844f05e91deb508b77e4e554dbea4bc6394802..2cffc83642f4d2c9d130606f00e81152d9d8c696 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -153,7 +153,6 @@ Heap::Heap()
       last_idle_notification_gc_count_(0),
       last_idle_notification_gc_count_init_(false),
       mark_sweeps_since_idle_round_started_(0),
-      ms_count_at_last_idle_notification_(0),
       gc_count_at_last_idle_gc_(0),
       scavenges_since_last_idle_round_(kIdleScavengeThreshold),
       gcs_since_last_deopt_(0),
@@ -5762,6 +5761,7 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
       uncommit = true;
     }
CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental");
+    mark_sweeps_since_idle_round_started_++;
     gc_count_at_last_idle_gc_ = gc_count_;
     if (uncommit) {
       new_space_.Shrink();
@@ -5837,10 +5837,6 @@ bool Heap::IdleNotification(int hint) {
     }
   }

-  int new_mark_sweeps = ms_count_ - ms_count_at_last_idle_notification_;
-  mark_sweeps_since_idle_round_started_ += new_mark_sweeps;
-  ms_count_at_last_idle_notification_ = ms_count_;
-
   int remaining_mark_sweeps = kMaxMarkSweepsInIdleRound -
                               mark_sweeps_since_idle_round_started_;

@@ -5858,6 +5854,7 @@ bool Heap::IdleNotification(int hint) {
     if (remaining_mark_sweeps <= 2 && hint >= kMinHintForFullGC) {
       CollectAllGarbage(kReduceMemoryFootprintMask,
                         "idle notification: finalize idle round");
+      mark_sweeps_since_idle_round_started_++;
     } else {
       incremental_marking()->Start();
     }
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index b24b0b3608344ffba6177e42df6edf3c02f217e2..271559e2f9b1d23ed59c28a255fe5444f27fd067 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -2291,7 +2291,6 @@ class Heap {

   void StartIdleRound() {
     mark_sweeps_since_idle_round_started_ = 0;
-    ms_count_at_last_idle_notification_ = ms_count_;
   }

   void FinishIdleRound() {
@@ -2368,7 +2367,6 @@ class Heap {
   bool last_idle_notification_gc_count_init_;

   int mark_sweeps_since_idle_round_started_;
-  int ms_count_at_last_idle_notification_;
   unsigned int gc_count_at_last_idle_gc_;
   int scavenges_since_last_idle_round_;



--
--
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/groups/opt_out.


Reply via email to