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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 | 124 |
125 // We do not know the allocation throughput before the first Scavenge. | 125 // We do not know the allocation throughput before the first Scavenge. |
126 // TODO(hpayer): Estimate allocation throughput before the first Scavenge. | 126 // TODO(hpayer): Estimate allocation throughput before the first Scavenge. |
127 if (new_space_allocation_throughput_in_bytes_per_ms == 0) { | 127 if (new_space_allocation_throughput_in_bytes_per_ms == 0) { |
128 new_space_allocation_limit = | 128 new_space_allocation_limit = |
129 static_cast<size_t>(new_space_size * kConservativeTimeRatio); | 129 static_cast<size_t>(new_space_size * kConservativeTimeRatio); |
130 } else { | 130 } else { |
131 // We have to trigger scavenge before we reach the end of new space. | 131 // We have to trigger scavenge before we reach the end of new space. |
132 size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms * | 132 size_t adjust_limit = new_space_allocation_throughput_in_bytes_per_ms * |
133 kTimeUntilNextIdleEvent; | 133 kTimeUntilNextIdleEvent; |
134 if (adjust_limit > new_space_allocation_limit) | 134 if (adjust_limit > new_space_allocation_limit) { |
135 new_space_allocation_limit = 0; | 135 new_space_allocation_limit = 0; |
136 else | 136 } else { |
137 new_space_allocation_limit -= adjust_limit; | 137 new_space_allocation_limit -= adjust_limit; |
138 } | |
139 } | |
140 | |
141 // The allocated new space limit to trigger a Scavange has to be at least | |
Erik Corry
2015/05/15 13:03:16
Scavange -> scavenge <-- note vowel change
Hannes Payer (out of office)
2015/05/15 15:12:49
Done. Fixed them all.
| |
142 // kMinimumNewSpaceSizeToPerformScavenge. | |
143 if (new_space_allocation_limit < kMinimumNewSpaceSizeToPerformScavenge) { | |
144 new_space_allocation_limit = kMinimumNewSpaceSizeToPerformScavenge; | |
138 } | 145 } |
139 | 146 |
140 if (scavenge_speed_in_bytes_per_ms == 0) { | 147 if (scavenge_speed_in_bytes_per_ms == 0) { |
141 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed; | 148 scavenge_speed_in_bytes_per_ms = kInitialConservativeScavengeSpeed; |
142 } | 149 } |
143 | 150 |
144 if (new_space_allocation_limit <= used_new_space_size) { | 151 if (new_space_allocation_limit <= used_new_space_size) { |
145 if (used_new_space_size / scavenge_speed_in_bytes_per_ms <= | 152 if (used_new_space_size / scavenge_speed_in_bytes_per_ms <= |
146 idle_time_in_ms) { | 153 idle_time_in_ms) { |
147 return true; | 154 return true; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 } | 383 } |
377 if (mutator_gcs > idle_mark_compacts_) { | 384 if (mutator_gcs > idle_mark_compacts_) { |
378 return kReduceLatency; | 385 return kReduceLatency; |
379 } | 386 } |
380 break; | 387 break; |
381 } | 388 } |
382 return mode_; | 389 return mode_; |
383 } | 390 } |
384 } | 391 } |
385 } | 392 } |
OLD | NEW |