| 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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 kReduceMemoryFootprintMask); | 759 kReduceMemoryFootprintMask); |
| 760 isolate_->compilation_cache()->Clear(); | 760 isolate_->compilation_cache()->Clear(); |
| 761 const int kMaxNumberOfAttempts = 7; | 761 const int kMaxNumberOfAttempts = 7; |
| 762 const int kMinNumberOfAttempts = 2; | 762 const int kMinNumberOfAttempts = 2; |
| 763 for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) { | 763 for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) { |
| 764 if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL) && | 764 if (!CollectGarbage(MARK_COMPACTOR, gc_reason, NULL) && |
| 765 attempt + 1 >= kMinNumberOfAttempts) { | 765 attempt + 1 >= kMinNumberOfAttempts) { |
| 766 break; | 766 break; |
| 767 } | 767 } |
| 768 } | 768 } |
| 769 |
| 769 mark_compact_collector()->SetFlags(kNoGCFlags); | 770 mark_compact_collector()->SetFlags(kNoGCFlags); |
| 770 new_space_.Shrink(); | 771 new_space_.Shrink(); |
| 771 UncommitFromSpace(); | 772 UncommitFromSpace(); |
| 772 incremental_marking()->UncommitMarkingDeque(); | 773 incremental_marking()->UncommitMarkingDeque(); |
| 773 } | 774 } |
| 774 | 775 |
| 775 | 776 |
| 776 void Heap::EnsureFillerObjectAtTop() { | 777 void Heap::EnsureFillerObjectAtTop() { |
| 777 // There may be an allocation memento behind every object in new space. | 778 // There may be an allocation memento behind every object in new space. |
| 778 // If we evacuate a not full new space or if we are on the last page of | 779 // If we evacuate a not full new space or if we are on the last page of |
| (...skipping 6964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7743 static_cast<int>(object_sizes_last_time_[index])); | 7744 static_cast<int>(object_sizes_last_time_[index])); |
| 7744 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7745 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 7745 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7746 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 7746 | 7747 |
| 7747 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7748 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 7748 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7749 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 7749 ClearObjectStats(); | 7750 ClearObjectStats(); |
| 7750 } | 7751 } |
| 7751 | 7752 |
| 7752 } } // namespace v8::internal | 7753 } } // namespace v8::internal |
| OLD | NEW |