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

Side by Side Diff: runtime/vm/scavenger.cc

Issue 534653002: Bump allocation for promotion (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | « runtime/vm/pages.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/scavenger.h" 5 #include "vm/scavenger.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // to space. 198 // to space.
199 new_addr = scavenger_->TryAllocate(size); 199 new_addr = scavenger_->TryAllocate(size);
200 class_table->UpdateLiveNew(cid, size); 200 class_table->UpdateLiveNew(cid, size);
201 } else { 201 } else {
202 // TODO(iposva): Experiment with less aggressive promotion. For example 202 // TODO(iposva): Experiment with less aggressive promotion. For example
203 // a coin toss determines if an object is promoted or whether it should 203 // a coin toss determines if an object is promoted or whether it should
204 // survive in this generation. 204 // survive in this generation.
205 // 205 //
206 // This object is a survivor of a previous scavenge. Attempt to promote 206 // This object is a survivor of a previous scavenge. Attempt to promote
207 // the object. 207 // the object.
208 new_addr = page_space_->TryAllocateDataLocked(size, 208 new_addr =
209 PageSpace::kForceGrowth); 209 page_space_->TryAllocatePromoLocked(size, PageSpace::kForceGrowth);
210 if (new_addr != 0) { 210 if (new_addr != 0) {
211 // If promotion succeeded then we need to remember it so that it can 211 // If promotion succeeded then we need to remember it so that it can
212 // be traversed later. 212 // be traversed later.
213 scavenger_->PushToPromotedStack(new_addr); 213 scavenger_->PushToPromotedStack(new_addr);
214 bytes_promoted_ += size; 214 bytes_promoted_ += size;
215 class_table->UpdateAllocatedOld(cid, size); 215 class_table->UpdateAllocatedOld(cid, size);
216 } else { 216 } else {
217 // Promotion did not succeed. Copy into the to space instead. 217 // Promotion did not succeed. Copy into the to space instead.
218 new_addr = scavenger_->TryAllocate(size); 218 new_addr = scavenger_->TryAllocate(size);
219 class_table->UpdateLiveNew(cid, size); 219 class_table->UpdateLiveNew(cid, size);
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 } 887 }
888 888
889 889
890 void Scavenger::FreeExternal(intptr_t size) { 890 void Scavenger::FreeExternal(intptr_t size) {
891 ASSERT(size >= 0); 891 ASSERT(size >= 0);
892 external_size_ -= size; 892 external_size_ -= size;
893 ASSERT(external_size_ >= 0); 893 ASSERT(external_size_ >= 0);
894 } 894 }
895 895
896 } // namespace dart 896 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/pages.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698