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 { |
11 | 11 |
12 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9; | 12 const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9; |
13 const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000000; | 13 const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000000; |
14 const size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100; | 14 const size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100; |
| 15 const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 7; |
| 16 const int GCIdleTimeHandler::kIdleScavengeThreshold = 5; |
15 | 17 |
16 | 18 |
17 size_t GCIdleTimeHandler::EstimateMarkingStepSize( | 19 size_t GCIdleTimeHandler::EstimateMarkingStepSize( |
18 size_t idle_time_in_ms, size_t marking_speed_in_bytes_per_ms) { | 20 size_t idle_time_in_ms, size_t marking_speed_in_bytes_per_ms) { |
19 DCHECK(idle_time_in_ms > 0); | 21 DCHECK(idle_time_in_ms > 0); |
20 | 22 |
21 if (marking_speed_in_bytes_per_ms == 0) { | 23 if (marking_speed_in_bytes_per_ms == 0) { |
22 marking_speed_in_bytes_per_ms = kInitialConservativeMarkingSpeed; | 24 marking_speed_in_bytes_per_ms = kInitialConservativeMarkingSpeed; |
23 } | 25 } |
24 | 26 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 idle_time_in_ms >= kMinTimeForFinalizeSweeping) { | 81 idle_time_in_ms >= kMinTimeForFinalizeSweeping) { |
80 return GCIdleTimeAction::FinalizeSweeping(); | 82 return GCIdleTimeAction::FinalizeSweeping(); |
81 } | 83 } |
82 | 84 |
83 size_t step_size = EstimateMarkingStepSize( | 85 size_t step_size = EstimateMarkingStepSize( |
84 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); | 86 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); |
85 return GCIdleTimeAction::IncrementalMarking(step_size); | 87 return GCIdleTimeAction::IncrementalMarking(step_size); |
86 } | 88 } |
87 } | 89 } |
88 } | 90 } |
OLD | NEW |