| 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 #ifndef VM_HEAP_H_ | 5 #ifndef VM_HEAP_H_ |
| 6 #define VM_HEAP_H_ | 6 #define VM_HEAP_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 kPromotionFailure, | 43 kPromotionFailure, |
| 44 kOldSpace, | 44 kOldSpace, |
| 45 kCodeSpace, | 45 kCodeSpace, |
| 46 kFull, | 46 kFull, |
| 47 kGCAtAlloc, | 47 kGCAtAlloc, |
| 48 kGCTestCase, | 48 kGCTestCase, |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 // Default allocation sizes in MB for the old gen and code heaps. | 51 // Default allocation sizes in MB for the old gen and code heaps. |
| 52 static const intptr_t kHeapSizeInMB = 512; | 52 static const intptr_t kHeapSizeInMB = 512; |
| 53 static const intptr_t kCodeHeapSizeInMB = 12; | 53 static const intptr_t kCodeHeapSizeInMB = 18; |
| 54 | 54 |
| 55 ~Heap(); | 55 ~Heap(); |
| 56 | 56 |
| 57 uword Allocate(intptr_t size, Space space) { | 57 uword Allocate(intptr_t size, Space space) { |
| 58 ASSERT(!read_only_); | 58 ASSERT(!read_only_); |
| 59 switch (space) { | 59 switch (space) { |
| 60 case kNew: | 60 case kNew: |
| 61 // Do not attempt to allocate very large objects in new space. | 61 // Do not attempt to allocate very large objects in new space. |
| 62 if (!PageSpace::IsPageAllocatableSize(size)) { | 62 if (!PageSpace::IsPageAllocatableSize(size)) { |
| 63 return AllocateOld(size); | 63 return AllocateOld(size); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 public: | 200 public: |
| 201 NoGCScope() {} | 201 NoGCScope() {} |
| 202 private: | 202 private: |
| 203 DISALLOW_COPY_AND_ASSIGN(NoGCScope); | 203 DISALLOW_COPY_AND_ASSIGN(NoGCScope); |
| 204 }; | 204 }; |
| 205 #endif // defined(DEBUG) | 205 #endif // defined(DEBUG) |
| 206 | 206 |
| 207 } // namespace dart | 207 } // namespace dart |
| 208 | 208 |
| 209 #endif // VM_HEAP_H_ | 209 #endif // VM_HEAP_H_ |
| OLD | NEW |