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 | 81 |
82 // Visit all pointers in the space. | 82 // Visit all pointers in the space. |
83 void IterateNewPointers(ObjectPointerVisitor* visitor); | 83 void IterateNewPointers(ObjectPointerVisitor* visitor); |
84 void IterateOldPointers(ObjectPointerVisitor* visitor); | 84 void IterateOldPointers(ObjectPointerVisitor* visitor); |
85 void IterateCodePointers(ObjectPointerVisitor* visitor); | 85 void IterateCodePointers(ObjectPointerVisitor* visitor); |
86 | 86 |
87 // Find an object by visiting all pointers in the specified heap space, | |
88 // the 'visitor' is used to determine if an object is found or not. | |
89 // The 'visitor' function should be set up to return true if the | |
90 // object is found, traversal through the heap space stops at that | |
91 // point. | |
92 // The 'visitor' function should return false if the object is not found, | |
93 // traversal through the heap space continues. | |
94 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor); | |
95 | |
96 void CollectGarbage(Space space); | 87 void CollectGarbage(Space space); |
97 void CollectGarbage(Space space, ApiCallbacks api_callbacks); | 88 void CollectGarbage(Space space, ApiCallbacks api_callbacks); |
98 void CollectAllGarbage(); | 89 void CollectAllGarbage(); |
99 | 90 |
100 // Accessors for inlined allocation in generated code. | 91 // Accessors for inlined allocation in generated code. |
101 uword TopAddress(); | 92 uword TopAddress(); |
102 uword EndAddress(); | 93 uword EndAddress(); |
103 static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); } | 94 static intptr_t new_space_offset() { return OFFSET_OF(Heap, new_space_); } |
104 | 95 |
105 // Initialize the heap and register it with the isolate. | 96 // Initialize the heap and register it with the isolate. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 public: | 128 public: |
138 NoGCScope() {} | 129 NoGCScope() {} |
139 private: | 130 private: |
140 DISALLOW_COPY_AND_ASSIGN(NoGCScope); | 131 DISALLOW_COPY_AND_ASSIGN(NoGCScope); |
141 }; | 132 }; |
142 #endif // defined(DEBUG) | 133 #endif // defined(DEBUG) |
143 | 134 |
144 } // namespace dart | 135 } // namespace dart |
145 | 136 |
146 #endif // VM_HEAP_H_ | 137 #endif // VM_HEAP_H_ |
OLD | NEW |