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

Side by Side Diff: vm/pages.cc

Issue 9027017: - Promote objects from new gen to old space if they survived a scavenge. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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 | « vm/pages.h ('k') | vm/raw_object.h » ('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 (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/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "vm/assert.h" 7 #include "vm/assert.h"
8 #include "vm/gc_marker.h" 8 #include "vm/gc_marker.h"
9 #include "vm/gc_sweeper.h" 9 #include "vm/gc_sweeper.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 137
138 uword PageSpace::TryAllocate(intptr_t size) { 138 uword PageSpace::TryAllocate(intptr_t size) {
139 ASSERT(size >= kObjectAlignment); 139 ASSERT(size >= kObjectAlignment);
140 ASSERT(Utils::IsAligned(size, kObjectAlignment)); 140 ASSERT(Utils::IsAligned(size, kObjectAlignment));
141 uword result = 0; 141 uword result = 0;
142 if (size < kAllocatablePageSize) { 142 if (size < kAllocatablePageSize) {
143 result = TryBumpAllocate(size); 143 result = TryBumpAllocate(size);
144 if (result == 0) { 144 if (result == 0) {
145 if (CanIncreaseCapacity(kPageSize)) { 145 result = freelist_.TryAllocate(size);
146 if ((result == 0) && CanIncreaseCapacity(kPageSize)) {
146 AllocatePage(); 147 AllocatePage();
147 result = TryBumpAllocate(size); 148 result = TryBumpAllocate(size);
148 ASSERT(result != 0); 149 ASSERT(result != 0);
149 } 150 }
150 } 151 }
151 } else { 152 } else {
152 // Large page allocation. 153 // Large page allocation.
153 intptr_t page_size = LargePageSizeFor(size); 154 intptr_t page_size = LargePageSizeFor(size);
154 if (page_size < size) { 155 if (page_size < size) {
155 // On overflow we fail to allocate. 156 // On overflow we fail to allocate.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 OS::PrintErr(" done.\n"); 273 OS::PrintErr(" done.\n");
273 } 274 }
274 275
275 count_++; 276 count_++;
276 // Done, reset the marker. 277 // Done, reset the marker.
277 ASSERT(sweeping_); 278 ASSERT(sweeping_);
278 sweeping_ = false; 279 sweeping_ = false;
279 } 280 }
280 281
281 } // namespace dart 282 } // namespace dart
OLDNEW
« no previous file with comments | « vm/pages.h ('k') | vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698