Index: src/heap/gc-idle-time-handler.h |
diff --git a/src/heap/gc-idle-time-handler.h b/src/heap/gc-idle-time-handler.h |
index e3a74627e56dd7da81fd3699cbae20c3bcfaa719..9b3b95e2c1ff58d17c6025fa49954335409eaa63 100644 |
--- a/src/heap/gc-idle-time-handler.h |
+++ b/src/heap/gc-idle-time-handler.h |
@@ -92,9 +92,18 @@ class GCIdleTimeHandler { |
// conservative lower bound for the mark-compact speed. |
static const size_t kInitialConservativeMarkCompactSpeed = 2 * MB; |
+ // If we haven't recorded any final incremental mark-compact events yet, we |
+ // use conservative lower bound for the mark-compact speed. |
+ static const size_t kInitialConservativeFinalIncrementalMarkCompactSpeed = |
+ 2 * MB; |
+ |
// Maximum mark-compact time returned by EstimateMarkCompactTime. |
static const size_t kMaxMarkCompactTimeInMs; |
+ // Maximum final incremental mark-compact time returned by |
+ // EstimateFinalIncrementalMarkCompactTime. |
+ static const size_t kMaxFinalIncrementalMarkCompactTimeInMs; |
+ |
// Minimum time to finalize sweeping phase. The main thread may wait for |
// sweeper threads. |
static const size_t kMinTimeForFinalizeSweeping; |
@@ -128,6 +137,7 @@ class GCIdleTimeHandler { |
bool sweeping_in_progress; |
size_t mark_compact_speed_in_bytes_per_ms; |
size_t incremental_marking_speed_in_bytes_per_ms; |
+ size_t final_incremental_mark_compact_speed_in_bytes_per_ms; |
size_t scavenge_speed_in_bytes_per_ms; |
size_t used_new_space_size; |
size_t new_space_capacity; |
@@ -158,6 +168,9 @@ class GCIdleTimeHandler { |
static size_t EstimateMarkCompactTime( |
size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); |
+ static size_t EstimateFinalIncrementalMarkCompactTime( |
+ size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); |
+ |
static bool ShouldDoMarkCompact(size_t idle_time_in_ms, |
size_t size_of_objects, |
size_t mark_compact_speed_in_bytes_per_ms); |
@@ -165,6 +178,10 @@ class GCIdleTimeHandler { |
static bool ShouldDoContextDisposalMarkCompact(bool context_disposed, |
double contexts_disposal_rate); |
+ static bool ShouldDoFinalIncrementalMarkCompact( |
+ size_t idle_time_in_ms, size_t size_of_objects, |
+ size_t final_incremental_mark_compact_speed_in_bytes_per_ms); |
+ |
static bool ShouldDoScavenge( |
size_t idle_time_in_ms, size_t new_space_size, size_t used_new_space_size, |
size_t scavenger_speed_in_bytes_per_ms, |