OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // Tells whether global handle is weak. | 155 // Tells whether global handle is weak. |
156 static bool IsWeak(Object** location); | 156 static bool IsWeak(Object** location); |
157 | 157 |
158 // Process pending weak handles. | 158 // Process pending weak handles. |
159 // Returns true if next major GC is likely to collect more garbage. | 159 // Returns true if next major GC is likely to collect more garbage. |
160 bool PostGarbageCollectionProcessing(GarbageCollector collector); | 160 bool PostGarbageCollectionProcessing(GarbageCollector collector); |
161 | 161 |
162 // Iterates over all strong handles. | 162 // Iterates over all strong handles. |
163 void IterateStrongRoots(ObjectVisitor* v); | 163 void IterateStrongRoots(ObjectVisitor* v); |
164 | 164 |
165 // Iterates over all strong and dependent handles. | |
166 void IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v); | |
167 | |
168 // Iterates over all handles. | 165 // Iterates over all handles. |
169 void IterateAllRoots(ObjectVisitor* v); | 166 void IterateAllRoots(ObjectVisitor* v); |
170 | 167 |
171 // Iterates over all handles that have embedder-assigned class ID. | 168 // Iterates over all handles that have embedder-assigned class ID. |
172 void IterateAllRootsWithClassIds(ObjectVisitor* v); | 169 void IterateAllRootsWithClassIds(ObjectVisitor* v); |
173 | 170 |
174 // Iterates over all weak roots in heap. | 171 // Iterates over all weak roots in heap. |
175 void IterateWeakRoots(ObjectVisitor* v); | 172 void IterateWeakRoots(ObjectVisitor* v); |
176 | 173 |
177 // Iterates over all weak independent roots in heap. | |
178 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); | |
179 | |
180 // Iterates over weak roots that are bound to a given callback. | 174 // Iterates over weak roots that are bound to a given callback. |
181 void IterateWeakRoots(WeakReferenceGuest f, | 175 void IterateWeakRoots(WeakReferenceGuest f, |
182 WeakReferenceCallback callback); | 176 WeakReferenceCallback callback); |
183 | 177 |
184 // Find all weak handles satisfying the callback predicate, mark | 178 // Find all weak handles satisfying the callback predicate, mark |
185 // them as pending. | 179 // them as pending. |
186 void IdentifyWeakHandles(WeakSlotCallback f); | 180 void IdentifyWeakHandles(WeakSlotCallback f); |
187 | 181 |
188 // Find all weak independent handles satisfying the callback predicate, mark | 182 // NOTE: Three ...NewSpace... functions below are used during |
189 // them as pending. | 183 // scavenge collections and iterate over sets of handles that are |
| 184 // guaranteed to contain all handles holding new space objects (but |
| 185 // may also include old space objects). |
| 186 |
| 187 // Iterates over strong and dependent handles. See the node above. |
| 188 void IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v); |
| 189 |
| 190 // Finds weak independent handles satisfying the callback predicate |
| 191 // and marks them as pending. See the note above. |
190 void IdentifyNewSpaceWeakIndependentHandles(WeakSlotCallbackWithHeap f); | 192 void IdentifyNewSpaceWeakIndependentHandles(WeakSlotCallbackWithHeap f); |
191 | 193 |
| 194 // Iterates over weak independent handles. See the note above. |
| 195 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); |
| 196 |
192 // Add an object group. | 197 // Add an object group. |
193 // Should be only used in GC callback function before a collection. | 198 // Should be only used in GC callback function before a collection. |
194 // All groups are destroyed after a mark-compact collection. | 199 // All groups are destroyed after a mark-compact collection. |
195 void AddObjectGroup(Object*** handles, | 200 void AddObjectGroup(Object*** handles, |
196 size_t length, | 201 size_t length, |
197 v8::RetainedObjectInfo* info); | 202 v8::RetainedObjectInfo* info); |
198 | 203 |
199 // Add an implicit references' group. | 204 // Add an implicit references' group. |
200 // Should be only used in GC callback function before a collection. | 205 // Should be only used in GC callback function before a collection. |
201 // All groups are destroyed after a mark-compact collection. | 206 // All groups are destroyed after a mark-compact collection. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 268 |
264 friend class Isolate; | 269 friend class Isolate; |
265 | 270 |
266 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); | 271 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
267 }; | 272 }; |
268 | 273 |
269 | 274 |
270 } } // namespace v8::internal | 275 } } // namespace v8::internal |
271 | 276 |
272 #endif // V8_GLOBAL_HANDLES_H_ | 277 #endif // V8_GLOBAL_HANDLES_H_ |
OLD | NEW |