| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 kPromotion, | 54 kPromotion, |
| 55 kOldSpace, | 55 kOldSpace, |
| 56 kFull, | 56 kFull, |
| 57 kGCAtAlloc, | 57 kGCAtAlloc, |
| 58 kGCTestCase, | 58 kGCTestCase, |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 #if defined(DEBUG) | 61 #if defined(DEBUG) |
| 62 // Pattern for unused new space and swept old space. | 62 // Pattern for unused new space and swept old space. |
| 63 static const uint64_t kZap64Bits = 0xf3f3f3f3f3f3f3f3; | 63 static const uint64_t kZap64Bits = 0xf3f3f3f3f3f3f3f3; |
| 64 static const uint32_t kZap32Bits = static_cast<uint32_t>(kZap64Bits); | 64 static const uint32_t kZap32Bits = 0xf3f3f3f3; |
| 65 static const uint8_t kZapByte = static_cast<uint8_t>(kZap64Bits); | 65 static const uint8_t kZapByte = 0xf3; |
| 66 #endif // DEBUG | 66 #endif // DEBUG |
| 67 | 67 |
| 68 ~Heap(); | 68 ~Heap(); |
| 69 | 69 |
| 70 Scavenger* new_space() const { return new_space_; } | 70 Scavenger* new_space() const { return new_space_; } |
| 71 PageSpace* old_space() const { return old_space_; } | 71 PageSpace* old_space() const { return old_space_; } |
| 72 | 72 |
| 73 uword Allocate(intptr_t size, Space space) { | 73 uword Allocate(intptr_t size, Space space) { |
| 74 ASSERT(!read_only_); | 74 ASSERT(!read_only_); |
| 75 switch (space) { | 75 switch (space) { |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 NoHeapGrowthControlScope(); | 358 NoHeapGrowthControlScope(); |
| 359 ~NoHeapGrowthControlScope(); | 359 ~NoHeapGrowthControlScope(); |
| 360 private: | 360 private: |
| 361 bool current_growth_controller_state_; | 361 bool current_growth_controller_state_; |
| 362 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 362 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 363 }; | 363 }; |
| 364 | 364 |
| 365 } // namespace dart | 365 } // namespace dart |
| 366 | 366 |
| 367 #endif // VM_HEAP_H_ | 367 #endif // VM_HEAP_H_ |
| OLD | NEW |