Print finalize incremental marking event in idle notification.
authorhpayer <hpayer@chromium.org>
Wed, 3 Dec 2014 10:03:14 +0000 (02:03 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Dec 2014 10:03:30 +0000 (10:03 +0000)
BUG=

Review URL: https://codereview.chromium.org/775013002

Cr-Commit-Position: refs/heads/master@{#25631}

src/heap/gc-idle-time-handler.cc
src/heap/gc-idle-time-handler.h
src/heap/heap.cc
src/heap/heap.h

index bbc4c394afcb18ab511d1394cf51b39e17ab697e..3a8691db2c197d30e8b3a0b18dd29a05f3ad1834 100644 (file)
@@ -29,6 +29,9 @@ void GCIdleTimeAction::Print() {
     case DO_INCREMENTAL_MARKING:
       PrintF("incremental marking with step %" V8_PTR_PREFIX "d / ms",
              parameter);
+      if (additional_work) {
+        PrintF("; finalized marking");
+      }
       break;
     case DO_SCAVENGE:
       PrintF("scavenge");
index 9b7f2b59977f1e96d571be1dd843c13ba798b118..204e57936b847aea093aac0e2de1bce05c9383a0 100644 (file)
@@ -26,6 +26,7 @@ class GCIdleTimeAction {
     GCIdleTimeAction result;
     result.type = DONE;
     result.parameter = 0;
+    result.additional_work = false;
     return result;
   }
 
@@ -33,6 +34,7 @@ class GCIdleTimeAction {
     GCIdleTimeAction result;
     result.type = DO_NOTHING;
     result.parameter = 0;
+    result.additional_work = false;
     return result;
   }
 
@@ -40,6 +42,7 @@ class GCIdleTimeAction {
     GCIdleTimeAction result;
     result.type = DO_INCREMENTAL_MARKING;
     result.parameter = step_size;
+    result.additional_work = false;
     return result;
   }
 
@@ -47,6 +50,7 @@ class GCIdleTimeAction {
     GCIdleTimeAction result;
     result.type = DO_SCAVENGE;
     result.parameter = 0;
+    result.additional_work = false;
     return result;
   }
 
@@ -54,6 +58,7 @@ class GCIdleTimeAction {
     GCIdleTimeAction result;
     result.type = DO_FULL_GC;
     result.parameter = 0;
+    result.additional_work = false;
     return result;
   }
 
@@ -61,6 +66,7 @@ class GCIdleTimeAction {
     GCIdleTimeAction result;
     result.type = DO_FINALIZE_SWEEPING;
     result.parameter = 0;
+    result.additional_work = false;
     return result;
   }
 
@@ -68,6 +74,7 @@ class GCIdleTimeAction {
 
   GCIdleTimeActionType type;
   intptr_t parameter;
+  bool additional_work;
 };
 
 
index 8c489bd940b1bd0eb5eec4ebd967974ac25ac2d8..b73a63e8c12faa9fa27f83a4ffdb8546b84bb242 100644 (file)
@@ -4409,7 +4409,7 @@ void Heap::IdleMarkCompact(const char* message) {
 }
 
 
-void Heap::TryFinalizeIdleIncrementalMarking(
+bool Heap::TryFinalizeIdleIncrementalMarking(
     double idle_time_in_ms, size_t size_of_objects,
     size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
   if (incremental_marking()->IsComplete() ||
@@ -4418,7 +4418,9 @@ void Heap::TryFinalizeIdleIncrementalMarking(
            static_cast<size_t>(idle_time_in_ms), size_of_objects,
            final_incremental_mark_compact_speed_in_bytes_per_ms))) {
     CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental");
+    return true;
   }
+  return false;
 }
 
 
@@ -4503,7 +4505,7 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
                !incremental_marking()->IsComplete() &&
                !mark_compact_collector_.marking_deque()->IsEmpty());
       if (remaining_idle_time_in_ms > 0.0) {
-        TryFinalizeIdleIncrementalMarking(
+        action.additional_work = TryFinalizeIdleIncrementalMarking(
             remaining_idle_time_in_ms, heap_state.size_of_objects,
             heap_state.final_incremental_mark_compact_speed_in_bytes_per_ms);
       }
index 9fa9497fb5ba9ac156b796e037ed64c19071b6f3..b83f2ea1966157ed61a0f95e4eb1431fbed4d23a 100644 (file)
@@ -2010,7 +2010,7 @@ class Heap {
 
   void IdleMarkCompact(const char* message);
 
-  void TryFinalizeIdleIncrementalMarking(
+  bool TryFinalizeIdleIncrementalMarking(
       double idle_time_in_ms, size_t size_of_objects,
       size_t mark_compact_speed_in_bytes_per_ms);