| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 // Heap contains the specified address. | 78 // Heap contains the specified address. |
| 79 bool Contains(uword addr) const; | 79 bool Contains(uword addr) const; |
| 80 bool CodeContains(uword addr) const; | 80 bool CodeContains(uword addr) const; |
| 81 bool StubCodeContains(uword addr) const; | 81 bool StubCodeContains(uword addr) const; |
| 82 | 82 |
| 83 // Visit all pointers in the space. | 83 // Visit all pointers in the space. |
| 84 void IterateNewPointers(ObjectPointerVisitor* visitor); | 84 void IterateNewPointers(ObjectPointerVisitor* visitor); |
| 85 void IterateOldPointers(ObjectPointerVisitor* visitor); | 85 void IterateOldPointers(ObjectPointerVisitor* visitor); |
| 86 void IterateCodePointers(ObjectPointerVisitor* visitor); | 86 void IterateCodePointers(ObjectPointerVisitor* visitor); |
| 87 void IterateStubCodePointers(ObjectPointerVisitor* visitor); | 87 |
| 88 // Visit all object in the space. |
| 89 void IterateNewObjects(ObjectVisitor* visitor); |
| 90 void IterateOldObjects(ObjectVisitor* visitor); |
| 91 void IterateCodeObjects(ObjectVisitor* visitor); |
| 88 | 92 |
| 89 // Find an object by visiting all pointers in the specified heap space, | 93 // Find an object by visiting all pointers in the specified heap space, |
| 90 // the 'visitor' is used to determine if an object is found or not. | 94 // the 'visitor' is used to determine if an object is found or not. |
| 91 // The 'visitor' function should be set up to return true if the | 95 // The 'visitor' function should be set up to return true if the |
| 92 // object is found, traversal through the heap space stops at that | 96 // object is found, traversal through the heap space stops at that |
| 93 // point. | 97 // point. |
| 94 // The 'visitor' function should return false if the object is not found, | 98 // The 'visitor' function should return false if the object is not found, |
| 95 // traversal through the heap space continues. | 99 // traversal through the heap space continues. |
| 96 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor); | 100 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor); |
| 97 RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor); | 101 RawInstructions* FindObjectInStubCodeSpace(FindObjectVisitor* visitor); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 public: | 154 public: |
| 151 NoGCScope() {} | 155 NoGCScope() {} |
| 152 private: | 156 private: |
| 153 DISALLOW_COPY_AND_ASSIGN(NoGCScope); | 157 DISALLOW_COPY_AND_ASSIGN(NoGCScope); |
| 154 }; | 158 }; |
| 155 #endif // defined(DEBUG) | 159 #endif // defined(DEBUG) |
| 156 | 160 |
| 157 } // namespace dart | 161 } // namespace dart |
| 158 | 162 |
| 159 #endif // VM_HEAP_H_ | 163 #endif // VM_HEAP_H_ |
| OLD | NEW |