| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 void IterateNewObjects(ObjectVisitor* visitor); | 127 void IterateNewObjects(ObjectVisitor* visitor); |
| 128 void IterateOldObjects(ObjectVisitor* visitor); | 128 void IterateOldObjects(ObjectVisitor* visitor); |
| 129 | 129 |
| 130 // Find an object by visiting all pointers in the specified heap space, | 130 // Find an object by visiting all pointers in the specified heap space, |
| 131 // the 'visitor' is used to determine if an object is found or not. | 131 // the 'visitor' is used to determine if an object is found or not. |
| 132 // The 'visitor' function should be set up to return true if the | 132 // The 'visitor' function should be set up to return true if the |
| 133 // object is found, traversal through the heap space stops at that | 133 // object is found, traversal through the heap space stops at that |
| 134 // point. | 134 // point. |
| 135 // The 'visitor' function should return false if the object is not found, | 135 // The 'visitor' function should return false if the object is not found, |
| 136 // traversal through the heap space continues. | 136 // traversal through the heap space continues. |
| 137 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor); | 137 // Returns null object if nothing is found. Must be called within a NoGCScope. |
| 138 RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor); | 138 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor) const; |
| 139 RawObject* FindOldObject(FindObjectVisitor* visitor) const; | 139 RawObject* FindOldObject(FindObjectVisitor* visitor) const; |
| 140 RawObject* FindNewObject(FindObjectVisitor* visitor) const; |
| 141 RawObject* FindObject(FindObjectVisitor* visitor) const; |
| 140 | 142 |
| 141 void CollectGarbage(Space space); | 143 void CollectGarbage(Space space); |
| 142 void CollectGarbage(Space space, ApiCallbacks api_callbacks); | 144 void CollectGarbage(Space space, ApiCallbacks api_callbacks); |
| 143 void CollectAllGarbage(); | 145 void CollectAllGarbage(); |
| 144 | 146 |
| 145 // Enables growth control on the page space heaps. This should be | 147 // Enables growth control on the page space heaps. This should be |
| 146 // called before any user code is executed. | 148 // called before any user code is executed. |
| 147 void EnableGrowthControl() { SetGrowthControlState(true); } | 149 void EnableGrowthControl() { SetGrowthControlState(true); } |
| 148 void DisableGrowthControl() { SetGrowthControlState(false); } | 150 void DisableGrowthControl() { SetGrowthControlState(false); } |
| 149 void SetGrowthControlState(bool state); | 151 void SetGrowthControlState(bool state); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 NoHeapGrowthControlScope(); | 338 NoHeapGrowthControlScope(); |
| 337 ~NoHeapGrowthControlScope(); | 339 ~NoHeapGrowthControlScope(); |
| 338 private: | 340 private: |
| 339 bool current_growth_controller_state_; | 341 bool current_growth_controller_state_; |
| 340 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 342 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 341 }; | 343 }; |
| 342 | 344 |
| 343 } // namespace dart | 345 } // namespace dart |
| 344 | 346 |
| 345 #endif // VM_HEAP_H_ | 347 #endif // VM_HEAP_H_ |
| OLD | NEW |