Chromium Code Reviews| 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 #if defined(ARCH_IS_32_BIT) | |
| 58 static const intptr_t kHeapSizeInMB = 512; | 59 static const intptr_t kHeapSizeInMB = 512; |
|
Ivan Posva
2013/09/13 07:41:08
How about the code below to avoid the ifdefs?
sta
kasperl
2013/09/13 07:46:22
Done.
| |
| 59 static const intptr_t kCodeHeapSizeInMB = 18; | 60 static const intptr_t kCodeHeapSizeInMB = 18; |
| 61 #else | |
| 62 static const intptr_t kHeapSizeInMB = 1024; | |
| 63 static const intptr_t kCodeHeapSizeInMB = 24; | |
| 64 #endif | |
| 60 | 65 |
| 61 ~Heap(); | 66 ~Heap(); |
| 62 | 67 |
| 63 uword Allocate(intptr_t size, Space space) { | 68 uword Allocate(intptr_t size, Space space) { |
| 64 ASSERT(!read_only_); | 69 ASSERT(!read_only_); |
| 65 switch (space) { | 70 switch (space) { |
| 66 case kNew: | 71 case kNew: |
| 67 // Do not attempt to allocate very large objects in new space. | 72 // Do not attempt to allocate very large objects in new space. |
| 68 if (!IsAllocatableInNewSpace(size)) { | 73 if (!IsAllocatableInNewSpace(size)) { |
| 69 return AllocateOld(size, HeapPage::kData); | 74 return AllocateOld(size, HeapPage::kData); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 NoHeapGrowthControlScope(); | 326 NoHeapGrowthControlScope(); |
| 322 ~NoHeapGrowthControlScope(); | 327 ~NoHeapGrowthControlScope(); |
| 323 private: | 328 private: |
| 324 bool current_growth_controller_state_; | 329 bool current_growth_controller_state_; |
| 325 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 330 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 326 }; | 331 }; |
| 327 | 332 |
| 328 } // namespace dart | 333 } // namespace dart |
| 329 | 334 |
| 330 #endif // VM_HEAP_H_ | 335 #endif // VM_HEAP_H_ |
| OLD | NEW |