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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 int NumberOfGlobalHandles() { | 148 int NumberOfGlobalHandles() { |
149 return number_of_global_handles_; | 149 return number_of_global_handles_; |
150 } | 150 } |
151 | 151 |
152 // Clear the weakness of a global handle. | 152 // Clear the weakness of a global handle. |
153 void ClearWeakness(Object** location); | 153 void ClearWeakness(Object** location); |
154 | 154 |
155 // Clear the weakness of a global handle. | 155 // Clear the weakness of a global handle. |
156 void MarkIndependent(Object** location); | 156 void MarkIndependent(Object** location); |
157 | 157 |
158 // Mark the reference to this object externaly unreachable. | |
159 void MarkExternallyUnreachable(Object** location); | |
160 | |
158 static bool IsIndependent(Object** location); | 161 static bool IsIndependent(Object** location); |
159 | 162 |
160 // Tells whether global handle is near death. | 163 // Tells whether global handle is near death. |
161 static bool IsNearDeath(Object** location); | 164 static bool IsNearDeath(Object** location); |
162 | 165 |
163 // Tells whether global handle is weak. | 166 // Tells whether global handle is weak. |
164 static bool IsWeak(Object** location); | 167 static bool IsWeak(Object** location); |
165 | 168 |
166 // Process pending weak handles. | 169 // Process pending weak handles. |
167 // Returns true if next major GC is likely to collect more garbage. | 170 // Returns true if next major GC is likely to collect more garbage. |
(...skipping 20 matching lines...) Expand all Loading... | |
188 void IdentifyWeakHandles(WeakSlotCallback f); | 191 void IdentifyWeakHandles(WeakSlotCallback f); |
189 | 192 |
190 // NOTE: Three ...NewSpace... functions below are used during | 193 // NOTE: Three ...NewSpace... functions below are used during |
191 // scavenge collections and iterate over sets of handles that are | 194 // scavenge collections and iterate over sets of handles that are |
192 // guaranteed to contain all handles holding new space objects (but | 195 // guaranteed to contain all handles holding new space objects (but |
193 // may also include old space objects). | 196 // may also include old space objects). |
194 | 197 |
195 // Iterates over strong and dependent handles. See the node above. | 198 // Iterates over strong and dependent handles. See the node above. |
196 void IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v); | 199 void IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v); |
197 | 200 |
198 // Finds weak independent handles satisfying the callback predicate | 201 // Finds weak independent handles satisfying the callback predicate |
Michael Starzinger
2012/11/05 10:47:27
s/independent/independent or partially dependent/
haraken
2012/11/05 12:42:07
Done.
| |
199 // and marks them as pending. See the note above. | 202 // and marks them as pending. See the note above. |
200 void IdentifyNewSpaceWeakIndependentHandles(WeakSlotCallbackWithHeap f); | 203 void IdentifyNewSpaceWeakIndependentHandles(WeakSlotCallbackWithHeap f); |
201 | 204 |
202 // Iterates over weak independent handles. See the note above. | 205 // Iterates over weak independent handles. See the note above. |
Michael Starzinger
2012/11/05 10:47:27
Likewise.
haraken
2012/11/05 12:42:07
Done.
| |
203 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); | 206 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); |
204 | 207 |
205 // Add an object group. | 208 // Add an object group. |
206 // Should be only used in GC callback function before a collection. | 209 // Should be only used in GC callback function before a collection. |
207 // All groups are destroyed after a mark-compact collection. | 210 // All groups are destroyed after a mark-compact collection. |
Michael Starzinger
2012/11/05 10:47:27
s/mark-compact collection/garbage collection/
haraken
2012/11/05 12:42:07
Done.
| |
208 void AddObjectGroup(Object*** handles, | 211 void AddObjectGroup(Object*** handles, |
209 size_t length, | 212 size_t length, |
210 v8::RetainedObjectInfo* info); | 213 v8::RetainedObjectInfo* info); |
211 | 214 |
212 // Add an implicit references' group. | 215 // Add an implicit references' group. |
213 // Should be only used in GC callback function before a collection. | 216 // Should be only used in GC callback function before a collection. |
214 // All groups are destroyed after a mark-compact collection. | 217 // All groups are destroyed after a mark-compact collection. |
215 void AddImplicitReferences(HeapObject** parent, | 218 void AddImplicitReferences(HeapObject** parent, |
216 Object*** children, | 219 Object*** children, |
217 size_t length); | 220 size_t length); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 | 282 |
280 friend class Isolate; | 283 friend class Isolate; |
281 | 284 |
282 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); | 285 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
283 }; | 286 }; |
284 | 287 |
285 | 288 |
286 } } // namespace v8::internal | 289 } } // namespace v8::internal |
287 | 290 |
288 #endif // V8_GLOBAL_HANDLES_H_ | 291 #endif // V8_GLOBAL_HANDLES_H_ |
OLD | NEW |