| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |