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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // Protect access to the heap. | 157 // Protect access to the heap. |
158 void WriteProtect(bool read_only); | 158 void WriteProtect(bool read_only); |
159 void WriteProtectCode(bool read_only) { | 159 void WriteProtectCode(bool read_only) { |
160 old_space_->WriteProtectCode(read_only); | 160 old_space_->WriteProtectCode(read_only); |
161 } | 161 } |
162 | 162 |
163 // Accessors for inlined allocation in generated code. | 163 // Accessors for inlined allocation in generated code. |
164 uword TopAddress(); | 164 uword TopAddress(); |
165 uword EndAddress(); | 165 uword EndAddress(); |
166 static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); } | 166 static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); } |
| 167 uword NewSpaceAddress() const { return reinterpret_cast<uword>(new_space_); } |
167 | 168 |
168 // Initialize the heap and register it with the isolate. | 169 // Initialize the heap and register it with the isolate. |
169 static void Init(Isolate* isolate, | 170 static void Init(Isolate* isolate, |
170 intptr_t max_new_gen_words, | 171 intptr_t max_new_gen_words, |
171 intptr_t max_old_gen_words); | 172 intptr_t max_old_gen_words); |
172 | 173 |
173 // Verify that all pointers in the heap point to the heap. | 174 // Verify that all pointers in the heap point to the heap. |
174 bool Verify() const; | 175 bool Verify() const; |
175 | 176 |
176 // Print heap sizes. | 177 // Print heap sizes. |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 NoHeapGrowthControlScope(); | 352 NoHeapGrowthControlScope(); |
352 ~NoHeapGrowthControlScope(); | 353 ~NoHeapGrowthControlScope(); |
353 private: | 354 private: |
354 bool current_growth_controller_state_; | 355 bool current_growth_controller_state_; |
355 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 356 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
356 }; | 357 }; |
357 | 358 |
358 } // namespace dart | 359 } // namespace dart |
359 | 360 |
360 #endif // VM_HEAP_H_ | 361 #endif // VM_HEAP_H_ |
OLD | NEW |