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/flags.h" |
5 #include "src/heap/gc-idle-time-handler.h" | 6 #include "src/heap/gc-idle-time-handler.h" |
6 #include "src/heap/gc-tracer.h" | 7 #include "src/heap/gc-tracer.h" |
7 #include "src/utils.h" | 8 #include "src/utils.h" |
8 | 9 |
9 namespace v8 { | 10 namespace v8 { |
10 namespace internal { | 11 namespace internal { |
11 | 12 |
12 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9; | 13 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9; |
13 const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000; | 14 const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000; |
14 const size_t GCIdleTimeHandler::kMaxFinalIncrementalMarkCompactTimeInMs = 1000; | 15 const size_t GCIdleTimeHandler::kMaxFinalIncrementalMarkCompactTimeInMs = 1000; |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } | 316 } |
316 | 317 |
317 if (heap_state.sweeping_in_progress) { | 318 if (heap_state.sweeping_in_progress) { |
318 if (heap_state.sweeping_completed) { | 319 if (heap_state.sweeping_completed) { |
319 return GCIdleTimeAction::FinalizeSweeping(); | 320 return GCIdleTimeAction::FinalizeSweeping(); |
320 } else { | 321 } else { |
321 return NothingOrDone(); | 322 return NothingOrDone(); |
322 } | 323 } |
323 } | 324 } |
324 | 325 |
325 if (heap_state.incremental_marking_stopped && | 326 if (!FLAG_incremental_marking || |
326 !heap_state.can_start_incremental_marking && !reduce_memory) { | 327 (heap_state.incremental_marking_stopped && |
| 328 !heap_state.can_start_incremental_marking && !reduce_memory)) { |
327 return NothingOrDone(); | 329 return NothingOrDone(); |
328 } | 330 } |
329 | 331 |
330 size_t step_size = EstimateMarkingStepSize( | 332 size_t step_size = EstimateMarkingStepSize( |
331 static_cast<size_t>(kIncrementalMarkingStepTimeInMs), | 333 static_cast<size_t>(kIncrementalMarkingStepTimeInMs), |
332 heap_state.incremental_marking_speed_in_bytes_per_ms); | 334 heap_state.incremental_marking_speed_in_bytes_per_ms); |
333 return GCIdleTimeAction::IncrementalMarking(step_size, reduce_memory); | 335 return GCIdleTimeAction::IncrementalMarking(step_size, reduce_memory); |
334 } | 336 } |
335 | 337 |
336 | 338 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 408 } |
407 if (mutator_gcs > idle_mark_compacts_) { | 409 if (mutator_gcs > idle_mark_compacts_) { |
408 return kReduceLatency; | 410 return kReduceLatency; |
409 } | 411 } |
410 break; | 412 break; |
411 } | 413 } |
412 return mode_; | 414 return mode_; |
413 } | 415 } |
414 } | 416 } |
415 } | 417 } |
OLD | NEW |