| 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 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 // The idle time handler makes decisions about which garbage collection | 13 // The idle time handler makes decisions about which garbage collection |
| 14 // operations are executing during IdleNotification. | 14 // operations are executing during IdleNotification. |
| 15 class GCIdleTimeHandler { | 15 class GCIdleTimeHandler { |
| 16 public: | 16 public: |
| 17 static intptr_t EstimateMarkingStepSize( | 17 static size_t EstimateMarkingStepSize(size_t idle_time_in_ms, |
| 18 int idle_time_in_ms, intptr_t marking_speed_in_bytes_per_ms); | 18 size_t marking_speed_in_bytes_per_ms); |
| 19 | 19 |
| 20 // If we haven't recorded any incremental marking events yet, we carefully | 20 // If we haven't recorded any incremental marking events yet, we carefully |
| 21 // mark with a conservative lower bound for the marking speed. | 21 // mark with a conservative lower bound for the marking speed. |
| 22 static const intptr_t kInitialConservativeMarkingSpeed = 100 * KB; | 22 static const size_t kInitialConservativeMarkingSpeed = 100 * KB; |
| 23 |
| 24 // Maximum marking step size returned by EstimateMarkingStepSize. |
| 25 static const size_t kMaximumMarkingStepSize = 700 * MB; |
| 23 | 26 |
| 24 // We have to make sure that we finish the IdleNotification before | 27 // We have to make sure that we finish the IdleNotification before |
| 25 // idle_time_in_ms. Hence, we conservatively prune our workload estimate. | 28 // idle_time_in_ms. Hence, we conservatively prune our workload estimate. |
| 26 static const double kConservativeTimeRatio; | 29 static const double kConservativeTimeRatio; |
| 27 | 30 |
| 28 private: | 31 private: |
| 29 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 32 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 } // namespace internal | 35 } // namespace internal |
| 33 } // namespace v8 | 36 } // namespace v8 |
| 34 | 37 |
| 35 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 38 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| OLD | NEW |