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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // If the limit is larger than the new space size, then scavenging used to be | 81 // If the limit is larger than the new space size, then scavenging used to be |
82 // really fast. We can take advantage of the whole new space. | 82 // really fast. We can take advantage of the whole new space. |
83 if (new_space_allocation_limit > new_space_size) { | 83 if (new_space_allocation_limit > new_space_size) { |
84 new_space_allocation_limit = new_space_size; | 84 new_space_allocation_limit = new_space_size; |
85 } | 85 } |
86 | 86 |
87 // We do not know the allocation throughput before the first Scavenge. | 87 // We do not know the allocation throughput before the first Scavenge. |
88 // TODO(hpayer): Estimate allocation throughput before the first Scavenge. | 88 // TODO(hpayer): Estimate allocation throughput before the first Scavenge. |
89 if (new_space_allocation_throughput_in_bytes_per_ms == 0) { | 89 if (new_space_allocation_throughput_in_bytes_per_ms == 0) { |
90 new_space_allocation_limit = new_space_size * kConservativeTimeRatio; | 90 new_space_allocation_limit = |
| 91 static_cast<size_t>(new_space_size * kConservativeTimeRatio); |
91 } else { | 92 } else { |
92 // We have to trigger scavenge before we reach the end of new space. | 93 // We have to trigger scavenge before we reach the end of new space. |
93 new_space_allocation_limit -= | 94 new_space_allocation_limit -= |
94 new_space_allocation_throughput_in_bytes_per_ms * | 95 new_space_allocation_throughput_in_bytes_per_ms * |
95 kMaxFrameRenderingIdleTime; | 96 kMaxFrameRenderingIdleTime; |
96 } | 97 } |
97 | 98 |
98 if (scavenge_speed_in_bytes_per_ms == 0) { | 99 if (scavenge_speed_in_bytes_per_ms == 0) { |
99 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed; | 100 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed; |
100 } | 101 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if (heap_state.incremental_marking_stopped && | 181 if (heap_state.incremental_marking_stopped && |
181 !heap_state.can_start_incremental_marking) { | 182 !heap_state.can_start_incremental_marking) { |
182 return GCIdleTimeAction::Nothing(); | 183 return GCIdleTimeAction::Nothing(); |
183 } | 184 } |
184 size_t step_size = EstimateMarkingStepSize( | 185 size_t step_size = EstimateMarkingStepSize( |
185 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); | 186 idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); |
186 return GCIdleTimeAction::IncrementalMarking(step_size); | 187 return GCIdleTimeAction::IncrementalMarking(step_size); |
187 } | 188 } |
188 } | 189 } |
189 } | 190 } |
OLD | NEW |