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

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

Issue 10458072: Force growth when retrying an old-space allocation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 | « no previous file | runtime/vm/pages.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/compiler_stats.h" 9 #include "vm/compiler_stats.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 69
70 uword Heap::AllocateOld(intptr_t size) { 70 uword Heap::AllocateOld(intptr_t size) {
71 ASSERT(Isolate::Current()->no_gc_scope_depth() == 0); 71 ASSERT(Isolate::Current()->no_gc_scope_depth() == 0);
72 uword addr = old_space_->TryAllocate(size); 72 uword addr = old_space_->TryAllocate(size);
73 if (addr == 0) { 73 if (addr == 0) {
74 CollectAllGarbage(); 74 CollectAllGarbage();
75 if (FLAG_verbose_gc) { 75 if (FLAG_verbose_gc) {
76 PrintSizes(); 76 PrintSizes();
77 } 77 }
78 addr = old_space_->TryAllocate(size); 78 addr = old_space_->TryAllocate(size, PageSpace::kForceGrowth);
79 if (addr == 0) { 79 if (addr == 0) {
80 OS::PrintErr("Exhausted heap space, trying to allocate %d bytes.\n", 80 OS::PrintErr("Exhausted heap space, trying to allocate %d bytes.\n",
81 size); 81 size);
82 } 82 }
83 } 83 }
84 return addr; 84 return addr;
85 } 85 }
86 86
87 87
88 uword Heap::AllocateCode(PageSpace* space, intptr_t size) { 88 uword Heap::AllocateCode(PageSpace* space, intptr_t size) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 isolate()->IncrementNoGCScopeDepth(); 225 isolate()->IncrementNoGCScopeDepth();
226 } 226 }
227 227
228 228
229 NoGCScope::~NoGCScope() { 229 NoGCScope::~NoGCScope() {
230 isolate()->DecrementNoGCScopeDepth(); 230 isolate()->DecrementNoGCScopeDepth();
231 } 231 }
232 #endif // defined(DEBUG) 232 #endif // defined(DEBUG)
233 233
234 } // namespace dart 234 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698