| 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 #include "src/heap/gc-idle-time-handler.h" | 5 #include "src/heap/gc-idle-time-handler.h" |
| 6 #include "src/heap/gc-tracer.h" | 6 #include "src/heap/gc-tracer.h" |
| 7 #include "src/utils.h" | 7 #include "src/utils.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 if (heap_state.incremental_marking_stopped) { | 247 if (heap_state.incremental_marking_stopped) { |
| 248 if (ShouldDoMarkCompact(static_cast<size_t>(idle_time_in_ms), | 248 if (ShouldDoMarkCompact(static_cast<size_t>(idle_time_in_ms), |
| 249 heap_state.size_of_objects, | 249 heap_state.size_of_objects, |
| 250 heap_state.mark_compact_speed_in_bytes_per_ms)) { | 250 heap_state.mark_compact_speed_in_bytes_per_ms)) { |
| 251 return GCIdleTimeAction::FullGC(); | 251 return GCIdleTimeAction::FullGC(); |
| 252 } | 252 } |
| 253 } | 253 } |
| 254 | 254 |
| 255 // TODO(hpayer): Estimate finalize sweeping time. | 255 // TODO(hpayer): Estimate finalize sweeping time. |
| 256 if (heap_state.sweeping_in_progress && | 256 if (heap_state.sweeping_in_progress) { |
| 257 static_cast<size_t>(idle_time_in_ms) >= kMinTimeForFinalizeSweeping) { | 257 if (static_cast<size_t>(idle_time_in_ms) >= kMinTimeForFinalizeSweeping) { |
| 258 return GCIdleTimeAction::FinalizeSweeping(); | 258 return GCIdleTimeAction::FinalizeSweeping(); |
| 259 } |
| 260 return NothingOrDone(); |
| 259 } | 261 } |
| 260 | 262 |
| 261 if (heap_state.incremental_marking_stopped && | 263 if (heap_state.incremental_marking_stopped && |
| 262 !heap_state.can_start_incremental_marking) { | 264 !heap_state.can_start_incremental_marking) { |
| 263 return NothingOrDone(); | 265 return NothingOrDone(); |
| 264 } | 266 } |
| 265 | 267 |
| 266 size_t step_size = EstimateMarkingStepSize( | 268 size_t step_size = EstimateMarkingStepSize( |
| 267 static_cast<size_t>(kIncrementalMarkingStepTimeInMs), | 269 static_cast<size_t>(kIncrementalMarkingStepTimeInMs), |
| 268 heap_state.incremental_marking_speed_in_bytes_per_ms); | 270 heap_state.incremental_marking_speed_in_bytes_per_ms); |
| 269 return GCIdleTimeAction::IncrementalMarking(step_size); | 271 return GCIdleTimeAction::IncrementalMarking(step_size); |
| 270 } | 272 } |
| 271 } | 273 } |
| 272 } | 274 } |
| OLD | NEW |