| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 // Find an object by visiting all pointers in the specified heap space, | 126 // Find an object by visiting all pointers in the specified heap space, |
| 127 // the 'visitor' is used to determine if an object is found or not. | 127 // the 'visitor' is used to determine if an object is found or not. |
| 128 // The 'visitor' function should be set up to return true if the | 128 // The 'visitor' function should be set up to return true if the |
| 129 // object is found, traversal through the heap space stops at that | 129 // object is found, traversal through the heap space stops at that |
| 130 // point. | 130 // point. |
| 131 // The 'visitor' function should return false if the object is not found, | 131 // The 'visitor' function should return false if the object is not found, |
| 132 // traversal through the heap space continues. | 132 // traversal through the heap space continues. |
| 133 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor); | 133 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor); |
| 134 RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor); | 134 RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor); |
| 135 RawObject* FindOldObject(FindObjectVisitor* visitor) const; |
| 135 | 136 |
| 136 void CollectGarbage(Space space); | 137 void CollectGarbage(Space space); |
| 137 void CollectGarbage(Space space, ApiCallbacks api_callbacks); | 138 void CollectGarbage(Space space, ApiCallbacks api_callbacks); |
| 138 void CollectAllGarbage(); | 139 void CollectAllGarbage(); |
| 139 | 140 |
| 140 // Enables growth control on the page space heaps. This should be | 141 // Enables growth control on the page space heaps. This should be |
| 141 // called before any user code is executed. | 142 // called before any user code is executed. |
| 142 void EnableGrowthControl() { SetGrowthControlState(true); } | 143 void EnableGrowthControl() { SetGrowthControlState(true); } |
| 143 void DisableGrowthControl() { SetGrowthControlState(false); } | 144 void DisableGrowthControl() { SetGrowthControlState(false); } |
| 144 void SetGrowthControlState(bool state); | 145 void SetGrowthControlState(bool state); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 NoHeapGrowthControlScope(); | 323 NoHeapGrowthControlScope(); |
| 323 ~NoHeapGrowthControlScope(); | 324 ~NoHeapGrowthControlScope(); |
| 324 private: | 325 private: |
| 325 bool current_growth_controller_state_; | 326 bool current_growth_controller_state_; |
| 326 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); | 327 DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope); |
| 327 }; | 328 }; |
| 328 | 329 |
| 329 } // namespace dart | 330 } // namespace dart |
| 330 | 331 |
| 331 #endif // VM_HEAP_H_ | 332 #endif // VM_HEAP_H_ |
| OLD | NEW |