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

Side by Side Diff: src/heap.cc

Issue 10552002: Unify promotion and allocation limit computation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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/mark-compact.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 gc_count_(0), 111 gc_count_(0),
112 remembered_unmapped_pages_index_(0), 112 remembered_unmapped_pages_index_(0),
113 unflattened_strings_length_(0), 113 unflattened_strings_length_(0),
114 #ifdef DEBUG 114 #ifdef DEBUG
115 allocation_allowed_(true), 115 allocation_allowed_(true),
116 allocation_timeout_(0), 116 allocation_timeout_(0),
117 disallow_allocation_failure_(false), 117 disallow_allocation_failure_(false),
118 debug_utils_(NULL), 118 debug_utils_(NULL),
119 #endif // DEBUG 119 #endif // DEBUG
120 new_space_high_promotion_mode_active_(false), 120 new_space_high_promotion_mode_active_(false),
121 old_gen_promotion_limit_(kMinimumPromotionLimit), 121 old_gen_promotion_limit_(kMinPromotionLimit),
122 old_gen_allocation_limit_(kMinimumAllocationLimit), 122 old_gen_allocation_limit_(kMinAllocationLimit),
123 old_gen_limit_factor_(1), 123 old_gen_limit_factor_(1),
124 size_of_old_gen_at_last_old_space_gc_(0), 124 size_of_old_gen_at_last_old_space_gc_(0),
125 external_allocation_limit_(0), 125 external_allocation_limit_(0),
126 amount_of_external_allocated_memory_(0), 126 amount_of_external_allocated_memory_(0),
127 amount_of_external_allocated_memory_at_last_global_gc_(0), 127 amount_of_external_allocated_memory_at_last_global_gc_(0),
128 old_gen_exhausted_(false), 128 old_gen_exhausted_(false),
129 store_buffer_rebuilder_(store_buffer()), 129 store_buffer_rebuilder_(store_buffer()),
130 hidden_symbol_(NULL), 130 hidden_symbol_(NULL),
131 global_gc_prologue_callback_(NULL), 131 global_gc_prologue_callback_(NULL),
132 global_gc_epilogue_callback_(NULL), 132 global_gc_epilogue_callback_(NULL),
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 // a structure with a long lifetime. 822 // a structure with a long lifetime.
823 // In this case we aggressively raise old generation memory limits to 823 // In this case we aggressively raise old generation memory limits to
824 // postpone subsequent mark-sweep collection and thus trade memory 824 // postpone subsequent mark-sweep collection and thus trade memory
825 // space for the mutation speed. 825 // space for the mutation speed.
826 old_gen_limit_factor_ = 2; 826 old_gen_limit_factor_ = 2;
827 } else { 827 } else {
828 old_gen_limit_factor_ = 1; 828 old_gen_limit_factor_ = 1;
829 } 829 }
830 830
831 old_gen_promotion_limit_ = 831 old_gen_promotion_limit_ =
832 OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_); 832 OldGenLimit(size_of_old_gen_at_last_old_space_gc_, kMinPromotionLimit);
833 old_gen_allocation_limit_ = 833 old_gen_allocation_limit_ =
834 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_); 834 OldGenLimit(size_of_old_gen_at_last_old_space_gc_, kMinAllocationLimit);
835 835
836 old_gen_exhausted_ = false; 836 old_gen_exhausted_ = false;
837 } else { 837 } else {
838 tracer_ = tracer; 838 tracer_ = tracer;
839 Scavenge(); 839 Scavenge();
840 tracer_ = NULL; 840 tracer_ = NULL;
841 841
842 UpdateSurvivalRateTrend(start_new_space_size); 842 UpdateSurvivalRateTrend(start_new_space_size);
843 } 843 }
844 844
(...skipping 6304 matching lines...) Expand 10 before | Expand all | Expand 10 after
7149 } else { 7149 } else {
7150 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. 7150 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died.
7151 } 7151 }
7152 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = 7152 remembered_unmapped_pages_[remembered_unmapped_pages_index_] =
7153 reinterpret_cast<Address>(p); 7153 reinterpret_cast<Address>(p);
7154 remembered_unmapped_pages_index_++; 7154 remembered_unmapped_pages_index_++;
7155 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; 7155 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages;
7156 } 7156 }
7157 7157
7158 } } // namespace v8::internal 7158 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698