| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void SetGrowthControlState(bool state); | 138 void SetGrowthControlState(bool state); |
| 139 bool GrowthControlState(); | 139 bool GrowthControlState(); |
| 140 | 140 |
| 141 // Protect access to the heap. | 141 // Protect access to the heap. |
| 142 void WriteProtect(bool read_only); | 142 void WriteProtect(bool read_only); |
| 143 void WriteProtectCode(bool read_only) { | 143 void WriteProtectCode(bool read_only) { |
| 144 old_space_->WriteProtectCode(read_only); | 144 old_space_->WriteProtectCode(read_only); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Accessors for inlined allocation in generated code. | 147 // Accessors for inlined allocation in generated code. |
| 148 uword TopAddress(); | 148 uword TopAddress(Space space); |
| 149 uword EndAddress(); | 149 uword EndAddress(Space space); |
| 150 static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); } | 150 Space SpaceForAllocation(intptr_t class_id) const; |
| 151 uword NewSpaceAddress() const { return reinterpret_cast<uword>(new_space_); } | |
| 152 | 151 |
| 153 // Initialize the heap and register it with the isolate. | 152 // Initialize the heap and register it with the isolate. |
| 154 static void Init(Isolate* isolate, | 153 static void Init(Isolate* isolate, |
| 155 intptr_t max_new_gen_words, | 154 intptr_t max_new_gen_words, |
| 156 intptr_t max_old_gen_words); | 155 intptr_t max_old_gen_words); |
| 157 | 156 |
| 158 // Verify that all pointers in the heap point to the heap. | 157 // Verify that all pointers in the heap point to the heap. |
| 159 bool Verify() const; | 158 bool Verify() const; |
| 160 | 159 |
| 161 // Print heap sizes. | 160 // Print heap sizes. |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 NoHeapGrowthControlScope(); | 352 NoHeapGrowthControlScope(); |
| 354 ~NoHeapGrowthControlScope(); | 353 ~NoHeapGrowthControlScope(); |
| 355 private: | 354 private: |
| 356 bool current_growth_controller_state_; | 355 bool current_growth_controller_state_; |
| 357 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 356 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 358 }; | 357 }; |
| 359 | 358 |
| 360 } // namespace dart | 359 } // namespace dart |
| 361 | 360 |
| 362 #endif // VM_HEAP_H_ | 361 #endif // VM_HEAP_H_ |
| OLD | NEW |