| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_PAGES_H_ | 5 #ifndef VM_PAGES_H_ |
| 6 #define VM_PAGES_H_ | 6 #define VM_PAGES_H_ |
| 7 | 7 |
| 8 #include "vm/freelist.h" | 8 #include "vm/freelist.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/virtual_memory.h" | 10 #include "vm/virtual_memory.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 RawObject* FindObject(FindObjectVisitor* visitor) const; | 180 RawObject* FindObject(FindObjectVisitor* visitor) const; |
| 181 | 181 |
| 182 // Collect the garbage in the page space using mark-sweep. | 182 // Collect the garbage in the page space using mark-sweep. |
| 183 void MarkSweep(bool invoke_api_callbacks); | 183 void MarkSweep(bool invoke_api_callbacks); |
| 184 | 184 |
| 185 static HeapPage* PageFor(RawObject* raw_obj) { | 185 static HeapPage* PageFor(RawObject* raw_obj) { |
| 186 return reinterpret_cast<HeapPage*>( | 186 return reinterpret_cast<HeapPage*>( |
| 187 RawObject::ToAddr(raw_obj) & ~(kPageSize -1)); | 187 RawObject::ToAddr(raw_obj) & ~(kPageSize -1)); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void StartEndAddress(uword* start, uword* end) const; |
| 191 |
| 190 void EnableGrowthControl() { | 192 void EnableGrowthControl() { |
| 191 page_space_controller_.Enable(); | 193 page_space_controller_.Enable(); |
| 192 } | 194 } |
| 193 | 195 |
| 194 private: | 196 private: |
| 195 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); | 197 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); |
| 196 | 198 |
| 197 void AllocatePage(); | 199 void AllocatePage(); |
| 198 void FreePage(HeapPage* page, HeapPage* previous_page); | 200 void FreePage(HeapPage* page, HeapPage* previous_page); |
| 199 HeapPage* AllocateLargePage(intptr_t size); | 201 HeapPage* AllocateLargePage(intptr_t size); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 bool sweeping_; | 240 bool sweeping_; |
| 239 | 241 |
| 240 PageSpaceController page_space_controller_; | 242 PageSpaceController page_space_controller_; |
| 241 | 243 |
| 242 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 244 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 243 }; | 245 }; |
| 244 | 246 |
| 245 } // namespace dart | 247 } // namespace dart |
| 246 | 248 |
| 247 #endif // VM_PAGES_H_ | 249 #endif // VM_PAGES_H_ |
| OLD | NEW |