Chromium Code Reviews| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 static const size_t kInitialConservativeScavengeSpeed = 100 * KB; | 131 static const size_t kInitialConservativeScavengeSpeed = 100 * KB; |
| 132 | 132 |
| 133 // If contexts are disposed at a higher rate a full gc is triggered. | 133 // If contexts are disposed at a higher rate a full gc is triggered. |
| 134 static const double kHighContextDisposalRate; | 134 static const double kHighContextDisposalRate; |
| 135 | 135 |
| 136 // Incremental marking step time. | 136 // Incremental marking step time. |
| 137 static const size_t kIncrementalMarkingStepTimeInMs = 1; | 137 static const size_t kIncrementalMarkingStepTimeInMs = 1; |
| 138 | 138 |
| 139 static const size_t kMinTimeForOverApproximatingWeakClosureInMs; | 139 static const size_t kMinTimeForOverApproximatingWeakClosureInMs; |
| 140 | 140 |
| 141 static const double kMinMillisecondsInBetweenMarkCompact; | |
|
jochen (gone - plz use gerrit)
2015/03/20 12:41:52
MinTime...InMs would be more consistent with the o
Hannes Payer (out of office)
2015/03/20 14:20:39
Done.
| |
| 142 | |
| 141 class HeapState { | 143 class HeapState { |
| 142 public: | 144 public: |
| 143 void Print(); | 145 void Print(); |
| 144 | 146 |
| 145 int contexts_disposed; | 147 int contexts_disposed; |
| 146 double contexts_disposal_rate; | 148 double contexts_disposal_rate; |
| 147 size_t size_of_objects; | 149 size_t size_of_objects; |
| 148 bool incremental_marking_stopped; | 150 bool incremental_marking_stopped; |
| 149 bool can_start_incremental_marking; | 151 bool can_start_incremental_marking; |
| 150 bool sweeping_in_progress; | 152 bool sweeping_in_progress; |
| 151 size_t mark_compact_speed_in_bytes_per_ms; | 153 size_t mark_compact_speed_in_bytes_per_ms; |
| 152 size_t incremental_marking_speed_in_bytes_per_ms; | 154 size_t incremental_marking_speed_in_bytes_per_ms; |
| 153 size_t final_incremental_mark_compact_speed_in_bytes_per_ms; | 155 size_t final_incremental_mark_compact_speed_in_bytes_per_ms; |
| 154 size_t scavenge_speed_in_bytes_per_ms; | 156 size_t scavenge_speed_in_bytes_per_ms; |
| 155 size_t used_new_space_size; | 157 size_t used_new_space_size; |
| 156 size_t new_space_capacity; | 158 size_t new_space_capacity; |
| 157 size_t new_space_allocation_throughput_in_bytes_per_ms; | 159 size_t new_space_allocation_throughput_in_bytes_per_ms; |
| 160 double last_mark_compact_time; | |
| 161 double current_time; | |
| 158 }; | 162 }; |
| 159 | 163 |
| 160 GCIdleTimeHandler() | 164 GCIdleTimeHandler() |
| 161 : mark_compacts_since_idle_round_started_(0), | 165 : mark_compacts_since_idle_round_started_(0), |
| 162 scavenges_since_last_idle_round_(0) {} | 166 scavenges_since_last_idle_round_(0) {} |
| 163 | 167 |
| 164 GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state); | 168 GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state); |
| 165 | 169 |
| 166 void NotifyIdleMarkCompact() { | 170 void NotifyIdleMarkCompact() { |
| 167 if (mark_compacts_since_idle_round_started_ < kMaxMarkCompactsInIdleRound) { | 171 if (mark_compacts_since_idle_round_started_ < kMaxMarkCompactsInIdleRound) { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 179 size_t marking_speed_in_bytes_per_ms); | 183 size_t marking_speed_in_bytes_per_ms); |
| 180 | 184 |
| 181 static size_t EstimateMarkCompactTime( | 185 static size_t EstimateMarkCompactTime( |
| 182 size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); | 186 size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); |
| 183 | 187 |
| 184 static size_t EstimateFinalIncrementalMarkCompactTime( | 188 static size_t EstimateFinalIncrementalMarkCompactTime( |
| 185 size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); | 189 size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); |
| 186 | 190 |
| 187 static bool ShouldDoMarkCompact(size_t idle_time_in_ms, | 191 static bool ShouldDoMarkCompact(size_t idle_time_in_ms, |
| 188 size_t size_of_objects, | 192 size_t size_of_objects, |
| 189 size_t mark_compact_speed_in_bytes_per_ms); | 193 size_t mark_compact_speed_in_bytes_per_ms, |
| 194 double last_mark_comact_time, | |
|
jochen (gone - plz use gerrit)
2015/03/20 12:41:52
idle_time_in_ms is a size_t value. Can last_mark_c
Hannes Payer (out of office)
2015/03/20 14:20:39
Done.
| |
| 195 double current_time); | |
| 190 | 196 |
| 191 static bool ShouldDoContextDisposalMarkCompact(int context_disposed, | 197 static bool ShouldDoContextDisposalMarkCompact(int context_disposed, |
| 192 double contexts_disposal_rate); | 198 double contexts_disposal_rate); |
| 193 | 199 |
| 194 static bool ShouldDoFinalIncrementalMarkCompact( | 200 static bool ShouldDoFinalIncrementalMarkCompact( |
| 195 size_t idle_time_in_ms, size_t size_of_objects, | 201 size_t idle_time_in_ms, size_t size_of_objects, |
| 196 size_t final_incremental_mark_compact_speed_in_bytes_per_ms); | 202 size_t final_incremental_mark_compact_speed_in_bytes_per_ms); |
| 197 | 203 |
| 198 static bool ShouldDoOverApproximateWeakClosure(size_t idle_time_in_ms); | 204 static bool ShouldDoOverApproximateWeakClosure(size_t idle_time_in_ms); |
| 199 | 205 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 215 int mark_compacts_since_idle_round_started_; | 221 int mark_compacts_since_idle_round_started_; |
| 216 int scavenges_since_last_idle_round_; | 222 int scavenges_since_last_idle_round_; |
| 217 | 223 |
| 218 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); | 224 DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); |
| 219 }; | 225 }; |
| 220 | 226 |
| 221 } // namespace internal | 227 } // namespace internal |
| 222 } // namespace v8 | 228 } // namespace v8 |
| 223 | 229 |
| 224 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ | 230 #endif // V8_HEAP_GC_IDLE_TIME_HANDLER_H_ |
| OLD | NEW |