| 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 <map> | 8 #include <map> | 
| 9 | 9 | 
| 10 #include "vm/freelist.h" | 10 #include "vm/freelist.h" | 
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 188     return size <= kAllocatablePageSize; | 188     return size <= kAllocatablePageSize; | 
| 189   } | 189   } | 
| 190 | 190 | 
| 191   void VisitObjects(ObjectVisitor* visitor) const; | 191   void VisitObjects(ObjectVisitor* visitor) const; | 
| 192   void VisitObjectPointers(ObjectPointerVisitor* visitor) const; | 192   void VisitObjectPointers(ObjectPointerVisitor* visitor) const; | 
| 193 | 193 | 
| 194   RawObject* FindObject(FindObjectVisitor* visitor, | 194   RawObject* FindObject(FindObjectVisitor* visitor, | 
| 195                         HeapPage::PageType type) const; | 195                         HeapPage::PageType type) const; | 
| 196 | 196 | 
| 197   // Collect the garbage in the page space using mark-sweep. | 197   // Collect the garbage in the page space using mark-sweep. | 
| 198   void MarkSweep(bool invoke_api_callbacks, const char* gc_reason); | 198   void MarkSweep(bool invoke_api_callbacks); | 
| 199 | 199 | 
| 200   static HeapPage* PageFor(RawObject* raw_obj) { | 200   static HeapPage* PageFor(RawObject* raw_obj) { | 
| 201     return reinterpret_cast<HeapPage*>( | 201     return reinterpret_cast<HeapPage*>( | 
| 202         RawObject::ToAddr(raw_obj) & ~(kPageSize -1)); | 202         RawObject::ToAddr(raw_obj) & ~(kPageSize -1)); | 
| 203   } | 203   } | 
| 204 | 204 | 
| 205   void StartEndAddress(uword* start, uword* end) const; | 205   void StartEndAddress(uword* start, uword* end) const; | 
| 206 | 206 | 
| 207   void EnableGrowthControl() { | 207   void EnableGrowthControl() { | 
| 208     page_space_controller_.Enable(); | 208     page_space_controller_.Enable(); | 
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 244   HeapPage* pages_tail_; | 244   HeapPage* pages_tail_; | 
| 245   HeapPage* large_pages_; | 245   HeapPage* large_pages_; | 
| 246 | 246 | 
| 247   PeerTable peer_table_; | 247   PeerTable peer_table_; | 
| 248 | 248 | 
| 249   // Various sizes being tracked for this generation. | 249   // Various sizes being tracked for this generation. | 
| 250   intptr_t max_capacity_; | 250   intptr_t max_capacity_; | 
| 251   intptr_t capacity_; | 251   intptr_t capacity_; | 
| 252   intptr_t in_use_; | 252   intptr_t in_use_; | 
| 253 | 253 | 
| 254   // Old-gen GC cycle count. |  | 
| 255   int count_; |  | 
| 256 |  | 
| 257   // Keep track whether a MarkSweep is currently running. | 254   // Keep track whether a MarkSweep is currently running. | 
| 258   bool sweeping_; | 255   bool sweeping_; | 
| 259 | 256 | 
| 260   PageSpaceController page_space_controller_; | 257   PageSpaceController page_space_controller_; | 
| 261 | 258 | 
| 262   DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 259   DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 
| 263 }; | 260 }; | 
| 264 | 261 | 
| 265 }  // namespace dart | 262 }  // namespace dart | 
| 266 | 263 | 
| 267 #endif  // VM_PAGES_H_ | 264 #endif  // VM_PAGES_H_ | 
| OLD | NEW | 
|---|