Reviewers: Hannes Payer,

Message:
PTAL

Description:
Start incremental marking in idle time handler only if it is worthwhile.

BUG=

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

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

Affected files (+10, -2 lines):
  M src/heap/heap.h
  M src/heap/heap.cc


Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 76046641cd4f07ee6b44262ae100e914bf03af61..762fcf348c035c6d56b3c4ca863d3c6dbcb50461 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -846,7 +846,7 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
   // generator needs incremental marking to stay off after it aborted.
   if (!mark_compact_collector()->abort_incremental_marking() &&
       incremental_marking()->IsStopped() &&
- incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull()) {
+      WorthActivatingIncrementalMarking()) {
     incremental_marking()->Start();
   }

@@ -4283,6 +4283,11 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
 }


+bool Heap::WorthActivatingIncrementalMarking() {
+ return incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull();
+}
+
+
 bool Heap::IdleNotification(int idle_time_in_ms) {
   // If incremental marking is off, we do not perform idle notification.
   if (!FLAG_incremental_marking) return true;
@@ -4298,7 +4303,8 @@ bool Heap::IdleNotification(int idle_time_in_ms) {
   bool result = false;
   switch (action.type) {
     case DO_INCREMENTAL_MARKING:
-      if (incremental_marking()->IsStopped()) {
+      if (incremental_marking()->IsStopped() &&
+          WorthActivatingIncrementalMarking()) {
         incremental_marking()->Start();
       }
       AdvanceIdleIncrementalMarking(action.parameter);
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 6886ddd70c9478fd6d80fce72af54a8ff0af41b1..3d617c4b85dc9a23918aabeaa025d599e5b7f2e0 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1932,6 +1932,8 @@ class Heap {

   void AdvanceIdleIncrementalMarking(intptr_t step_size);

+  bool WorthActivatingIncrementalMarking();
+
   void ClearObjectStats(bool clear_last_time_stats = false);

   void set_weak_object_to_code_table(Object* value) {


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