| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_GLOBAL_HANDLES_H_ | 5 #ifndef V8_GLOBAL_HANDLES_H_ |
| 6 #define V8_GLOBAL_HANDLES_H_ | 6 #define V8_GLOBAL_HANDLES_H_ |
| 7 | 7 |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "include/v8-profiler.h" | 9 #include "include/v8-profiler.h" |
| 10 | 10 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // class ID. | 197 // class ID. |
| 198 void IterateAllRootsInNewSpaceWithClassIds(ObjectVisitor* v); | 198 void IterateAllRootsInNewSpaceWithClassIds(ObjectVisitor* v); |
| 199 | 199 |
| 200 // Iterates over all weak roots in heap. | 200 // Iterates over all weak roots in heap. |
| 201 void IterateWeakRoots(ObjectVisitor* v); | 201 void IterateWeakRoots(ObjectVisitor* v); |
| 202 | 202 |
| 203 // Find all weak handles satisfying the callback predicate, mark | 203 // Find all weak handles satisfying the callback predicate, mark |
| 204 // them as pending. | 204 // them as pending. |
| 205 void IdentifyWeakHandles(WeakSlotCallback f); | 205 void IdentifyWeakHandles(WeakSlotCallback f); |
| 206 | 206 |
| 207 // NOTE: Five ...NewSpace... functions below are used during | 207 // NOTE: Three ...NewSpace... functions below are used during |
| 208 // scavenge collections and iterate over sets of handles that are | 208 // scavenge collections and iterate over sets of handles that are |
| 209 // guaranteed to contain all handles holding new space objects (but | 209 // guaranteed to contain all handles holding new space objects (but |
| 210 // may also include old space objects). | 210 // may also include old space objects). |
| 211 | 211 |
| 212 // Iterates over strong and dependent handles. See the node above. | 212 // Iterates over strong and dependent handles. See the node above. |
| 213 void IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v); | 213 void IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v); |
| 214 | 214 |
| 215 // Finds weak independent or partially independent handles satisfying | 215 // Finds weak independent or partially independent handles satisfying |
| 216 // the callback predicate and marks them as pending. See the note above. | 216 // the callback predicate and marks them as pending. See the note above. |
| 217 void IdentifyNewSpaceWeakIndependentHandles(WeakSlotCallbackWithHeap f); | 217 void IdentifyNewSpaceWeakIndependentHandles(WeakSlotCallbackWithHeap f); |
| 218 | 218 |
| 219 // Iterates over weak independent or partially independent handles. | 219 // Iterates over weak independent or partially independent handles. |
| 220 // See the note above. | 220 // See the note above. |
| 221 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); | 221 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); |
| 222 | 222 |
| 223 // Finds weak independent or unmodified handles satisfying | |
| 224 // the callback predicate and marks them as pending. See the note above. | |
| 225 void MarkNewSpaceWeakUnmodifiedObjectsPending( | |
| 226 WeakSlotCallbackWithHeap is_unscavenged); | |
| 227 | |
| 228 // Iterates over weak independent or unmodified handles. | |
| 229 // See the note above. | |
| 230 void IterateNewSpaceWeakUnmodifiedRoots(ObjectVisitor* v); | |
| 231 | |
| 232 // Identify unmodified objects that are in weak state and marks them | |
| 233 // unmodified | |
| 234 void IdentifyWeakUnmodifiedObjects(WeakSlotCallback is_unmodified); | |
| 235 | |
| 236 // Iterate over objects in object groups that have at least one object | 223 // Iterate over objects in object groups that have at least one object |
| 237 // which requires visiting. The callback has to return true if objects | 224 // which requires visiting. The callback has to return true if objects |
| 238 // can be skipped and false otherwise. | 225 // can be skipped and false otherwise. |
| 239 bool IterateObjectGroups(ObjectVisitor* v, WeakSlotCallbackWithHeap can_skip); | 226 bool IterateObjectGroups(ObjectVisitor* v, WeakSlotCallbackWithHeap can_skip); |
| 240 | 227 |
| 241 // Add an object group. | 228 // Add an object group. |
| 242 // Should be only used in GC callback function before a collection. | 229 // Should be only used in GC callback function before a collection. |
| 243 // All groups are destroyed after a garbage collection. | 230 // All groups are destroyed after a garbage collection. |
| 244 void AddObjectGroup(Object*** handles, | 231 void AddObjectGroup(Object*** handles, |
| 245 size_t length, | 232 size_t length, |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; | 435 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; |
| 449 | 436 |
| 450 DISALLOW_COPY_AND_ASSIGN(EternalHandles); | 437 DISALLOW_COPY_AND_ASSIGN(EternalHandles); |
| 451 }; | 438 }; |
| 452 | 439 |
| 453 | 440 |
| 454 } // namespace internal | 441 } // namespace internal |
| 455 } // namespace v8 | 442 } // namespace v8 |
| 456 | 443 |
| 457 #endif // V8_GLOBAL_HANDLES_H_ | 444 #endif // V8_GLOBAL_HANDLES_H_ |
| OLD | NEW |