Chromium Code Reviews| Index: src/heap/heap.cc |
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
| index e801ff94cfb3ab9f4593712a68c62960a6748f3f..df12e79beaaf030d3d1039d079f701d461c8dec4 100644 |
| --- a/src/heap/heap.cc |
| +++ b/src/heap/heap.cc |
| @@ -4564,6 +4564,18 @@ void Heap::MakeHeapIterable() { |
| DCHECK(IsHeapIterable()); |
| } |
| + |
| +void Heap::ReduceNewSpaceSize(GCIdleTimeAction action) { |
| + if (action.reduce_memory && |
| + (action.type == DO_SCAVENGE || action.type == DO_FULL_GC || |
|
ulan
2015/05/21 12:29:31
what about DO_NOTHING and DONE?
Hannes Payer (out of office)
2015/05/21 12:31:08
I think it just makes sense after an actual GC, be
|
| + (action.type == DO_INCREMENTAL_MARKING && |
| + incremental_marking()->IsStopped()))) { |
| + new_space_.Shrink(); |
| + UncommitFromSpace(); |
| + } |
| +} |
| + |
| + |
| bool Heap::TryFinalizeIdleIncrementalMarking( |
| double idle_time_in_ms, size_t size_of_objects, |
| size_t final_incremental_mark_compact_speed_in_bytes_per_ms) { |
| @@ -4685,10 +4697,7 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action, |
| break; |
| } |
| - if (action.reduce_memory) { |
| - new_space_.Shrink(); |
| - UncommitFromSpace(); |
| - } |
| + ReduceNewSpaceSize(action); |
| return result; |
| } |