| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 237 } |
| 238 | 238 |
| 239 if (heap_state.incremental_marking_stopped) { | 239 if (heap_state.incremental_marking_stopped) { |
| 240 if (ShouldDoMarkCompact(static_cast<size_t>(idle_time_in_ms), | 240 if (ShouldDoMarkCompact(static_cast<size_t>(idle_time_in_ms), |
| 241 heap_state.size_of_objects, | 241 heap_state.size_of_objects, |
| 242 heap_state.mark_compact_speed_in_bytes_per_ms)) { | 242 heap_state.mark_compact_speed_in_bytes_per_ms)) { |
| 243 return GCIdleTimeAction::FullGC(); | 243 return GCIdleTimeAction::FullGC(); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 if (heap_state.sweeping_in_progress && heap_state.sweeping_completed) { | 247 if (heap_state.sweeping_in_progress) { |
| 248 return GCIdleTimeAction::FinalizeSweeping(); | 248 if (heap_state.sweeping_completed) { |
| 249 return GCIdleTimeAction::FinalizeSweeping(); |
| 250 } |
| 251 return GCIdleTimeAction::Nothing(); |
| 249 } | 252 } |
| 250 | 253 |
| 251 if (heap_state.incremental_marking_stopped && | 254 if (heap_state.incremental_marking_stopped && |
| 252 !heap_state.can_start_incremental_marking) { | 255 !heap_state.can_start_incremental_marking) { |
| 253 return GCIdleTimeAction::Nothing(); | 256 return GCIdleTimeAction::Nothing(); |
| 254 } | 257 } |
| 255 size_t step_size = EstimateMarkingStepSize( | 258 size_t step_size = EstimateMarkingStepSize( |
| 256 static_cast<size_t>(kIncrementalMarkingStepTimeInMs), | 259 static_cast<size_t>(kIncrementalMarkingStepTimeInMs), |
| 257 heap_state.incremental_marking_speed_in_bytes_per_ms); | 260 heap_state.incremental_marking_speed_in_bytes_per_ms); |
| 258 return GCIdleTimeAction::IncrementalMarking(step_size); | 261 return GCIdleTimeAction::IncrementalMarking(step_size); |
| 259 } | 262 } |
| 260 } | 263 } |
| 261 } | 264 } |
| OLD | NEW |