OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5596 intptr_t size_factor = Min(Max(hint, 20), kMaxHint) / 4; | 5596 intptr_t size_factor = Min(Max(hint, 20), kMaxHint) / 4; |
5597 // The size factor is in range [5..250]. The numbers here are chosen from | 5597 // The size factor is in range [5..250]. The numbers here are chosen from |
5598 // experiments. If you changes them, make sure to test with | 5598 // experiments. If you changes them, make sure to test with |
5599 // chrome/performance_ui_tests --gtest_filter="GeneralMixMemoryTest.* | 5599 // chrome/performance_ui_tests --gtest_filter="GeneralMixMemoryTest.* |
5600 intptr_t step_size = | 5600 intptr_t step_size = |
5601 size_factor * IncrementalMarking::kAllocatedThreshold; | 5601 size_factor * IncrementalMarking::kAllocatedThreshold; |
5602 | 5602 |
5603 if (contexts_disposed_ > 0) { | 5603 if (contexts_disposed_ > 0) { |
5604 contexts_disposed_ = 0; | 5604 contexts_disposed_ = 0; |
5605 int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000); | 5605 int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000); |
5606 if (hint >= mark_sweep_time && !FLAG_expose_gc && | 5606 if (hint >= mark_sweep_time) { |
5607 incremental_marking()->IsStopped()) { | |
5608 HistogramTimerScope scope(isolate_->counters()->gc_context()); | 5607 HistogramTimerScope scope(isolate_->counters()->gc_context()); |
5609 CollectAllGarbage(kReduceMemoryFootprintMask, | 5608 CollectAllGarbage( |
5610 "idle notification: contexts disposed"); | 5609 kReduceMemoryFootprintMask | kAbortIncrementalMarkingMask, |
Michael Starzinger
2014/01/20 14:09:30
This not only removes the special handling of --ex
Hannes Payer (out of office)
2014/01/20 14:28:42
Done, makes sense. I will do that.
| |
5610 "idle notification: contexts disposed"); | |
5611 } else { | 5611 } else { |
5612 AdvanceIdleIncrementalMarking(step_size); | 5612 AdvanceIdleIncrementalMarking(step_size); |
5613 } | 5613 } |
5614 | 5614 |
5615 // After context disposal there is likely a lot of garbage remaining, reset | 5615 // After context disposal there is likely a lot of garbage remaining, reset |
5616 // the idle notification counters in order to trigger more incremental GCs | 5616 // the idle notification counters in order to trigger more incremental GCs |
5617 // on subsequent idle notifications. | 5617 // on subsequent idle notifications. |
5618 StartIdleRound(); | 5618 StartIdleRound(); |
5619 return false; | 5619 return false; |
5620 } | 5620 } |
5621 | 5621 |
5622 if (!FLAG_incremental_marking || FLAG_expose_gc || Serializer::enabled()) { | 5622 if (!FLAG_incremental_marking || Serializer::enabled()) { |
5623 return IdleGlobalGC(); | 5623 return IdleGlobalGC(); |
5624 } | 5624 } |
5625 | 5625 |
5626 // By doing small chunks of GC work in each IdleNotification, | 5626 // By doing small chunks of GC work in each IdleNotification, |
5627 // perform a round of incremental GCs and after that wait until | 5627 // perform a round of incremental GCs and after that wait until |
5628 // the mutator creates enough garbage to justify a new round. | 5628 // the mutator creates enough garbage to justify a new round. |
5629 // An incremental GC progresses as follows: | 5629 // An incremental GC progresses as follows: |
5630 // 1. many incremental marking steps, | 5630 // 1. many incremental marking steps, |
5631 // 2. one old space mark-sweep-compact, | 5631 // 2. one old space mark-sweep-compact, |
5632 // 3. many lazy sweep steps. | 5632 // 3. many lazy sweep steps. |
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7737 static_cast<int>(object_sizes_last_time_[index])); | 7737 static_cast<int>(object_sizes_last_time_[index])); |
7738 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7738 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
7739 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7739 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7740 | 7740 |
7741 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7741 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7742 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7742 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7743 ClearObjectStats(); | 7743 ClearObjectStats(); |
7744 } | 7744 } |
7745 | 7745 |
7746 } } // namespace v8::internal | 7746 } } // namespace v8::internal |
OLD | NEW |