Chromium Code Reviews| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 | 139 |
| 140 // Returns the current number of weak handles to global objects. | 140 // Returns the current number of weak handles to global objects. |
| 141 // These handles are also included in NumberOfWeakHandles(). | 141 // These handles are also included in NumberOfWeakHandles(). |
| 142 int NumberOfGlobalObjectWeakHandles() { | 142 int NumberOfGlobalObjectWeakHandles() { |
| 143 return number_of_global_object_weak_handles_; | 143 return number_of_global_object_weak_handles_; |
| 144 } | 144 } |
| 145 | 145 |
| 146 // Clear the weakness of a global handle. | 146 // Clear the weakness of a global handle. |
| 147 void ClearWeakness(Object** location); | 147 void ClearWeakness(Object** location); |
| 148 | 148 |
| 149 // Clear the weakness of a global handle. | |
| 150 void MarkIndependent(Object** location); | |
| 151 | |
| 149 // Tells whether global handle is near death. | 152 // Tells whether global handle is near death. |
| 150 static bool IsNearDeath(Object** location); | 153 static bool IsNearDeath(Object** location); |
| 151 | 154 |
| 152 // Tells whether global handle is weak. | 155 // Tells whether global handle is weak. |
| 153 static bool IsWeak(Object** location); | 156 static bool IsWeak(Object** location); |
| 154 | 157 |
| 155 // Process pending weak handles. | 158 // Process pending weak handles. |
| 156 // 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. |
| 157 bool PostGarbageCollectionProcessing(); | 160 bool PostGarbageCollectionProcessing(); |
| 158 | 161 |
| 159 // Iterates over all strong handles. | 162 // Iterates over all strong handles. |
| 160 void IterateStrongRoots(ObjectVisitor* v); | 163 void IterateStrongRoots(ObjectVisitor* v); |
| 161 | 164 |
| 165 // Iterates over all strong and dependent handles. | |
| 166 void IterateStrongAndDependentRoots(ObjectVisitor* v); | |
| 167 | |
| 162 // Iterates over all handles. | 168 // Iterates over all handles. |
| 163 void IterateAllRoots(ObjectVisitor* v); | 169 void IterateAllRoots(ObjectVisitor* v); |
| 164 | 170 |
| 165 // Iterates over all handles that have embedder-assigned class ID. | 171 // Iterates over all handles that have embedder-assigned class ID. |
| 166 void IterateAllRootsWithClassIds(ObjectVisitor* v); | 172 void IterateAllRootsWithClassIds(ObjectVisitor* v); |
| 167 | 173 |
| 168 // Iterates over all weak roots in heap. | 174 // Iterates over all weak roots in heap. |
| 169 void IterateWeakRoots(ObjectVisitor* v); | 175 void IterateWeakRoots(ObjectVisitor* v); |
| 170 | 176 |
| 177 // Iterates over all weak independent roots in heap. | |
| 178 void IterateWeakIndependentRoots(ObjectVisitor* v); | |
| 179 | |
| 171 // Iterates over weak roots that are bound to a given callback. | 180 // Iterates over weak roots that are bound to a given callback. |
| 172 void IterateWeakRoots(WeakReferenceGuest f, | 181 void IterateWeakRoots(WeakReferenceGuest f, |
| 173 WeakReferenceCallback callback); | 182 WeakReferenceCallback callback); |
| 174 | 183 |
| 184 // Iterates over weak independent roots that are bound to a given callback. | |
|
Vitaly Repeshko
2011/05/16 13:42:11
The comment is wrong, but we should most likely re
Vyacheslav Egorov (Chromium)
2011/05/16 14:15:46
Yep. Thanks for catching it. Copy/paste with wrong
| |
| 185 void IdentifyWeakIndependentHandles(WeakSlotCallbackWithHeap f); | |
| 186 | |
| 175 // Find all weak handles satisfying the callback predicate, mark | 187 // Find all weak handles satisfying the callback predicate, mark |
| 176 // them as pending. | 188 // them as pending. |
| 177 void IdentifyWeakHandles(WeakSlotCallback f); | 189 void IdentifyWeakHandles(WeakSlotCallback f); |
| 178 | 190 |
| 179 // Add an object group. | 191 // Add an object group. |
| 180 // Should be only used in GC callback function before a collection. | 192 // Should be only used in GC callback function before a collection. |
| 181 // All groups are destroyed after a mark-compact collection. | 193 // All groups are destroyed after a mark-compact collection. |
| 182 void AddObjectGroup(Object*** handles, | 194 void AddObjectGroup(Object*** handles, |
| 183 size_t length, | 195 size_t length, |
| 184 v8::RetainedObjectInfo* info); | 196 v8::RetainedObjectInfo* info); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 | 274 |
| 263 friend class Isolate; | 275 friend class Isolate; |
| 264 | 276 |
| 265 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); | 277 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
| 266 }; | 278 }; |
| 267 | 279 |
| 268 | 280 |
| 269 } } // namespace v8::internal | 281 } } // namespace v8::internal |
| 270 | 282 |
| 271 #endif // V8_GLOBAL_HANDLES_H_ | 283 #endif // V8_GLOBAL_HANDLES_H_ |
| OLD | NEW |