| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 5 #ifndef V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| 6 #define V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 6 #define V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| 7 | 7 |
| 8 #include "src/globals.h" | 8 #include "src/globals.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 size_t new_space_allocation_throughput_in_bytes_per_ms; | 190 size_t new_space_allocation_throughput_in_bytes_per_ms; |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 GCIdleTimeHandler() | 193 GCIdleTimeHandler() |
| 194 : idle_mark_compacts_(0), | 194 : idle_mark_compacts_(0), |
| 195 mark_compacts_(0), | 195 mark_compacts_(0), |
| 196 scavenges_(0), | 196 scavenges_(0), |
| 197 long_idle_notifications_(0), | 197 long_idle_notifications_(0), |
| 198 background_idle_notifications_(0), | 198 background_idle_notifications_(0), |
| 199 idle_times_which_made_no_progress_per_mode_(0), | 199 idle_times_which_made_no_progress_per_mode_(0), |
| 200 next_gc_likely_to_collect_more_(false), |
| 200 mode_(kReduceLatency) {} | 201 mode_(kReduceLatency) {} |
| 201 | 202 |
| 202 GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state); | 203 GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state); |
| 203 | 204 |
| 204 void NotifyIdleMarkCompact() { ++idle_mark_compacts_; } | 205 void NotifyIdleMarkCompact() { ++idle_mark_compacts_; } |
| 205 | 206 |
| 206 void NotifyMarkCompact() { ++mark_compacts_; } | 207 void NotifyMarkCompact(bool next_gc_likely_to_collect_more) { |
| 208 next_gc_likely_to_collect_more_ = next_gc_likely_to_collect_more; |
| 209 ++mark_compacts_; |
| 210 } |
| 207 | 211 |
| 208 void NotifyScavenge() { ++scavenges_; } | 212 void NotifyScavenge() { ++scavenges_; } |
| 209 | 213 |
| 210 static size_t EstimateMarkingStepSize(size_t idle_time_in_ms, | 214 static size_t EstimateMarkingStepSize(size_t idle_time_in_ms, |
| 211 size_t marking_speed_in_bytes_per_ms); | 215 size_t marking_speed_in_bytes_per_ms); |
| 212 | 216 |
| 213 static size_t EstimateMarkCompactTime( | 217 static size_t EstimateMarkCompactTime( |
| 214 size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); | 218 size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); |
| 215 | 219 |
| 216 static size_t EstimateFinalIncrementalMarkCompactTime( | 220 static size_t EstimateFinalIncrementalMarkCompactTime( |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 int scavenges_; | 258 int scavenges_; |
| 255 // The number of long idle notifications with no GC happening | 259 // The number of long idle notifications with no GC happening |
| 256 // between the notifications. | 260 // between the notifications. |
| 257 int long_idle_notifications_; | 261 int long_idle_notifications_; |
| 258 // The number of background idle notifications with no GC happening | 262 // The number of background idle notifications with no GC happening |
| 259 // between the notifications. | 263 // between the notifications. |
| 260 int background_idle_notifications_; | 264 int background_idle_notifications_; |
| 261 // Idle notifications with no progress in the current mode. | 265 // Idle notifications with no progress in the current mode. |
| 262 int idle_times_which_made_no_progress_per_mode_; | 266 int idle_times_which_made_no_progress_per_mode_; |
| 263 | 267 |
| 268 bool next_gc_likely_to_collect_more_; |
| 269 |
| 264 Mode mode_; | 270 Mode mode_; |
| 265 | 271 |
| 266 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 272 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
| 267 }; | 273 }; |
| 268 | 274 |
| 269 } // namespace internal | 275 } // namespace internal |
| 270 } // namespace v8 | 276 } // namespace v8 |
| 271 | 277 |
| 272 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 278 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| OLD | NEW |