Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/heap.cc

Issue 10376008: Use correct size of promoted space for setting promotion and allocation limits. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove new-line Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/incremental-marking.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 798
799 if (collector == MARK_COMPACTOR) { 799 if (collector == MARK_COMPACTOR) {
800 // Perform mark-sweep with optional compaction. 800 // Perform mark-sweep with optional compaction.
801 MarkCompact(tracer); 801 MarkCompact(tracer);
802 sweep_generation_++; 802 sweep_generation_++;
803 bool high_survival_rate_during_scavenges = IsHighSurvivalRate() && 803 bool high_survival_rate_during_scavenges = IsHighSurvivalRate() &&
804 IsStableOrIncreasingSurvivalTrend(); 804 IsStableOrIncreasingSurvivalTrend();
805 805
806 UpdateSurvivalRateTrend(start_new_space_size); 806 UpdateSurvivalRateTrend(start_new_space_size);
807 807
808 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSize(); 808 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects();
809 809
810 if (high_survival_rate_during_scavenges && 810 if (high_survival_rate_during_scavenges &&
811 IsStableOrIncreasingSurvivalTrend()) { 811 IsStableOrIncreasingSurvivalTrend()) {
812 // Stable high survival rates of young objects both during partial and 812 // Stable high survival rates of young objects both during partial and
813 // full collection indicate that mutator is either building or modifying 813 // full collection indicate that mutator is either building or modifying
814 // a structure with a long lifetime. 814 // a structure with a long lifetime.
815 // In this case we aggressively raise old generation memory limits to 815 // In this case we aggressively raise old generation memory limits to
816 // postpone subsequent mark-sweep collection and thus trade memory 816 // postpone subsequent mark-sweep collection and thus trade memory
817 // space for the mutation speed. 817 // space for the mutation speed.
818 old_gen_limit_factor_ = 2; 818 old_gen_limit_factor_ = 2;
(...skipping 4984 matching lines...) Expand 10 before | Expand all | Expand 10 after
5803 obj = iterator.next()) { 5803 obj = iterator.next()) {
5804 InstanceType type = obj->map()->instance_type(); 5804 InstanceType type = obj->map()->instance_type();
5805 ASSERT(0 <= type && type <= LAST_TYPE); 5805 ASSERT(0 <= type && type <= LAST_TYPE);
5806 stats->objects_per_type[type]++; 5806 stats->objects_per_type[type]++;
5807 stats->size_per_type[type] += obj->Size(); 5807 stats->size_per_type[type] += obj->Size();
5808 } 5808 }
5809 } 5809 }
5810 } 5810 }
5811 5811
5812 5812
5813 intptr_t Heap::PromotedSpaceSize() {
5814 return old_pointer_space_->Size()
5815 + old_data_space_->Size()
5816 + code_space_->Size()
5817 + map_space_->Size()
5818 + cell_space_->Size()
5819 + lo_space_->Size();
5820 }
5821
5822
5823 intptr_t Heap::PromotedSpaceSizeOfObjects() { 5813 intptr_t Heap::PromotedSpaceSizeOfObjects() {
5824 return old_pointer_space_->SizeOfObjects() 5814 return old_pointer_space_->SizeOfObjects()
5825 + old_data_space_->SizeOfObjects() 5815 + old_data_space_->SizeOfObjects()
5826 + code_space_->SizeOfObjects() 5816 + code_space_->SizeOfObjects()
5827 + map_space_->SizeOfObjects() 5817 + map_space_->SizeOfObjects()
5828 + cell_space_->SizeOfObjects() 5818 + cell_space_->SizeOfObjects()
5829 + lo_space_->SizeOfObjects(); 5819 + lo_space_->SizeOfObjects();
5830 } 5820 }
5831 5821
5832 5822
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
7139 } else { 7129 } else {
7140 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. 7130 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died.
7141 } 7131 }
7142 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = 7132 remembered_unmapped_pages_[remembered_unmapped_pages_index_] =
7143 reinterpret_cast<Address>(p); 7133 reinterpret_cast<Address>(p);
7144 remembered_unmapped_pages_index_++; 7134 remembered_unmapped_pages_index_++;
7145 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; 7135 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages;
7146 } 7136 }
7147 7137
7148 } } // namespace v8::internal 7138 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698