| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // Number of times we will return a Nothing action in the current mode | 118 // Number of times we will return a Nothing action in the current mode |
| 119 // despite having idle time available before we returning a Done action to | 119 // despite having idle time available before we returning a Done action to |
| 120 // ensure we don't keep scheduling idle tasks and making no progress. | 120 // ensure we don't keep scheduling idle tasks and making no progress. |
| 121 static const int kMaxNoProgressIdleTimes = 10; | 121 static const int kMaxNoProgressIdleTimes = 10; |
| 122 | 122 |
| 123 GCIdleTimeHandler() : idle_times_which_made_no_progress_(0) {} | 123 GCIdleTimeHandler() : idle_times_which_made_no_progress_(0) {} |
| 124 | 124 |
| 125 GCIdleTimeAction Compute(double idle_time_in_ms, | 125 GCIdleTimeAction Compute(double idle_time_in_ms, |
| 126 GCIdleTimeHeapState heap_state); | 126 GCIdleTimeHeapState heap_state); |
| 127 | 127 |
| 128 bool Enabled(); |
| 129 |
| 128 void ResetNoProgressCounter() { idle_times_which_made_no_progress_ = 0; } | 130 void ResetNoProgressCounter() { idle_times_which_made_no_progress_ = 0; } |
| 129 | 131 |
| 130 static size_t EstimateMarkingStepSize(double idle_time_in_ms, | 132 static size_t EstimateMarkingStepSize(double idle_time_in_ms, |
| 131 double marking_speed_in_bytes_per_ms); | 133 double marking_speed_in_bytes_per_ms); |
| 132 | 134 |
| 133 static double EstimateFinalIncrementalMarkCompactTime( | 135 static double EstimateFinalIncrementalMarkCompactTime( |
| 134 size_t size_of_objects, double mark_compact_speed_in_bytes_per_ms); | 136 size_t size_of_objects, double mark_compact_speed_in_bytes_per_ms); |
| 135 | 137 |
| 136 static bool ShouldDoContextDisposalMarkCompact(int context_disposed, | 138 static bool ShouldDoContextDisposalMarkCompact(int context_disposed, |
| 137 double contexts_disposal_rate); | 139 double contexts_disposal_rate); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 148 // Idle notifications with no progress. | 150 // Idle notifications with no progress. |
| 149 int idle_times_which_made_no_progress_; | 151 int idle_times_which_made_no_progress_; |
| 150 | 152 |
| 151 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 153 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
| 152 }; | 154 }; |
| 153 | 155 |
| 154 } // namespace internal | 156 } // namespace internal |
| 155 } // namespace v8 | 157 } // namespace v8 |
| 156 | 158 |
| 157 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 159 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| OLD | NEW |