| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 size_t idle_time_in_ms, size_t size_of_objects, | 224 size_t idle_time_in_ms, size_t size_of_objects, |
| 225 size_t final_incremental_mark_compact_speed_in_bytes_per_ms); | 225 size_t final_incremental_mark_compact_speed_in_bytes_per_ms); |
| 226 | 226 |
| 227 static bool ShouldDoOverApproximateWeakClosure(size_t idle_time_in_ms); | 227 static bool ShouldDoOverApproximateWeakClosure(size_t idle_time_in_ms); |
| 228 | 228 |
| 229 static bool ShouldDoScavenge( | 229 static bool ShouldDoScavenge( |
| 230 size_t idle_time_in_ms, size_t new_space_size, size_t used_new_space_size, | 230 size_t idle_time_in_ms, size_t new_space_size, size_t used_new_space_size, |
| 231 size_t scavenger_speed_in_bytes_per_ms, | 231 size_t scavenger_speed_in_bytes_per_ms, |
| 232 size_t new_space_allocation_throughput_in_bytes_per_ms); | 232 size_t new_space_allocation_throughput_in_bytes_per_ms); |
| 233 | 233 |
| 234 bool ShouldGrowHeapSlowly() { |
| 235 return mode() == kDone; |
| 236 } |
| 237 |
| 234 enum Mode { kReduceLatency, kReduceMemory, kDone }; | 238 enum Mode { kReduceLatency, kReduceMemory, kDone }; |
| 235 | 239 |
| 236 Mode mode() { return mode_; } | 240 Mode mode() { return mode_; } |
| 237 | 241 |
| 238 private: | 242 private: |
| 239 bool IsMutatorActive(int contexts_disposed, int gcs); | 243 bool IsMutatorActive(int contexts_disposed, int gcs); |
| 240 bool IsMutatorIdle(int long_idle_notifications, | 244 bool IsMutatorIdle(int long_idle_notifications, |
| 241 int background_idle_notifications, int gcs); | 245 int background_idle_notifications, int gcs); |
| 242 void UpdateCounters(double idle_time_in_ms); | 246 void UpdateCounters(double idle_time_in_ms); |
| 243 void ResetCounters(); | 247 void ResetCounters(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 260 | 264 |
| 261 Mode mode_; | 265 Mode mode_; |
| 262 | 266 |
| 263 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 267 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
| 264 }; | 268 }; |
| 265 | 269 |
| 266 } // namespace internal | 270 } // namespace internal |
| 267 } // namespace v8 | 271 } // namespace v8 |
| 268 | 272 |
| 269 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 273 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| OLD | NEW |