| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 bool IsValidAddress(uword addr) const { | 193 bool IsValidAddress(uword addr) const { |
| 194 return Contains(addr); | 194 return Contains(addr); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void VisitObjects(ObjectVisitor* visitor) const; | 197 void VisitObjects(ObjectVisitor* visitor) const; |
| 198 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; | 198 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; |
| 199 | 199 |
| 200 RawObject* FindObject(FindObjectVisitor* visitor, | 200 RawObject* FindObject(FindObjectVisitor* visitor, |
| 201 HeapPage::PageType type) const; | 201 HeapPage::PageType type) const; |
| 202 | 202 |
| 203 // Runs a visitor that attempts to drop references to code that has not | 203 // Checks if enough time has elapsed since the last attempt to collect |
| 204 // been run in awhile. | 204 // code. |
| 205 void TryDetachingCode(); | 205 bool ShouldTryCollectingCode(); |
| 206 | 206 |
| 207 // Collect the garbage in the page space using mark-sweep. | 207 // Collect the garbage in the page space using mark-sweep. |
| 208 void MarkSweep(bool invoke_api_callbacks); | 208 void MarkSweep(bool invoke_api_callbacks); |
| 209 | 209 |
| 210 void StartEndAddress(uword* start, uword* end) const; | 210 void StartEndAddress(uword* start, uword* end) const; |
| 211 | 211 |
| 212 void SetGrowthControlState(bool state) { | 212 void SetGrowthControlState(bool state) { |
| 213 page_space_controller_.set_is_enabled(state); | 213 page_space_controller_.set_is_enabled(state); |
| 214 } | 214 } |
| 215 | 215 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 PageSpaceController page_space_controller_; | 268 PageSpaceController page_space_controller_; |
| 269 | 269 |
| 270 friend class PageSpaceController; | 270 friend class PageSpaceController; |
| 271 | 271 |
| 272 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 272 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 } // namespace dart | 275 } // namespace dart |
| 276 | 276 |
| 277 #endif // VM_PAGES_H_ | 277 #endif // VM_PAGES_H_ |
| OLD | NEW |