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 125 matching lines...) Loading... |
136 if (!heap_state.can_start_incremental_marking) { | 136 if (!heap_state.can_start_incremental_marking) { |
137 return GCIdleTimeAction::Nothing(); | 137 return GCIdleTimeAction::Nothing(); |
138 } | 138 } |
139 } | 139 } |
140 // TODO(hpayer): Estimate finalize sweeping time. | 140 // TODO(hpayer): Estimate finalize sweeping time. |
141 if (heap_state.sweeping_in_progress && | 141 if (heap_state.sweeping_in_progress && |
142 idle_time_in_ms >= kMinTimeForFinalizeSweeping) { | 142 idle_time_in_ms >= kMinTimeForFinalizeSweeping) { |
143 return GCIdleTimeAction::FinalizeSweeping(); | 143 return GCIdleTimeAction::FinalizeSweeping(); |
144 } | 144 } |
145 | 145 |
146 if (heap_state.incremental_marking_stopped && | 146 if (heap_state.incremental_marking_stopped || |
147 !heap_state.can_start_incremental_marking) { | 147 !heap_state.can_start_incremental_marking) { |
148 return GCIdleTimeAction::Nothing(); | 148 return GCIdleTimeAction::Nothing(); |
149 } | 149 } |
150 size_t step_size = EstimateMarkingStepSize( | 150 size_t step_size = EstimateMarkingStepSize( |
151 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); | 151 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); |
152 return GCIdleTimeAction::IncrementalMarking(step_size); | 152 return GCIdleTimeAction::IncrementalMarking(step_size); |
153 } | 153 } |
154 } | 154 } |
155 } | 155 } |
OLD | NEW |