| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 enum GCReason { | 48 enum GCReason { |
| 49 kNewSpace, | 49 kNewSpace, |
| 50 kPromotionFailure, | 50 kPromotionFailure, |
| 51 kOldSpace, | 51 kOldSpace, |
| 52 kFull, | 52 kFull, |
| 53 kGCAtAlloc, | 53 kGCAtAlloc, |
| 54 kGCTestCase, | 54 kGCTestCase, |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // Default allocation sizes in MB for the old gen and code heaps. | 57 // Default allocation sizes in MB for the old gen and code heaps. |
| 58 static const intptr_t kHeapSizeInMB = 512; | 58 static const intptr_t kHeapSizeInMWords = 128; |
| 59 static const intptr_t kHeapSizeInMB = kHeapSizeInMWords * kWordSize; |
| 59 static const intptr_t kCodeHeapSizeInMB = 18; | 60 static const intptr_t kCodeHeapSizeInMB = 18; |
| 60 | 61 |
| 61 ~Heap(); | 62 ~Heap(); |
| 62 | 63 |
| 63 uword Allocate(intptr_t size, Space space) { | 64 uword Allocate(intptr_t size, Space space) { |
| 64 ASSERT(!read_only_); | 65 ASSERT(!read_only_); |
| 65 switch (space) { | 66 switch (space) { |
| 66 case kNew: | 67 case kNew: |
| 67 // Do not attempt to allocate very large objects in new space. | 68 // Do not attempt to allocate very large objects in new space. |
| 68 if (!IsAllocatableInNewSpace(size)) { | 69 if (!IsAllocatableInNewSpace(size)) { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 NoHeapGrowthControlScope(); | 322 NoHeapGrowthControlScope(); |
| 322 ~NoHeapGrowthControlScope(); | 323 ~NoHeapGrowthControlScope(); |
| 323 private: | 324 private: |
| 324 bool current_growth_controller_state_; | 325 bool current_growth_controller_state_; |
| 325 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 326 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 326 }; | 327 }; |
| 327 | 328 |
| 328 } // namespace dart | 329 } // namespace dart |
| 329 | 330 |
| 330 #endif // VM_HEAP_H_ | 331 #endif // VM_HEAP_H_ |
| OLD | NEW |