Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(303)

Side by Side Diff: src/global-handles.h

Issue 11085015: Allow collection of DOM objects in minor GC cycles. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: All comments addressed Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 MarkPartiallyDependent(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
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 or partially independent handles satisfying
199 // and marks them as pending. See the note above. 202 // the callback predicate 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 or partially independent handles.
206 // See the note above.
203 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); 207 void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v);
204 208
205 // Add an object group. 209 // Add an object group.
206 // Should be only used in GC callback function before a collection. 210 // Should be only used in GC callback function before a collection.
207 // All groups are destroyed after a mark-compact collection. 211 // All groups are destroyed after a garbage collection.
208 void AddObjectGroup(Object*** handles, 212 void AddObjectGroup(Object*** handles,
209 size_t length, 213 size_t length,
210 v8::RetainedObjectInfo* info); 214 v8::RetainedObjectInfo* info);
211 215
212 // Add an implicit references' group. 216 // Add an implicit references' group.
213 // Should be only used in GC callback function before a collection. 217 // Should be only used in GC callback function before a collection.
214 // All groups are destroyed after a mark-compact collection. 218 // All groups are destroyed after a mark-compact collection.
215 void AddImplicitReferences(HeapObject** parent, 219 void AddImplicitReferences(HeapObject** parent,
216 Object*** children, 220 Object*** children,
217 size_t length); 221 size_t length);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 283
280 friend class Isolate; 284 friend class Isolate;
281 285
282 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); 286 DISALLOW_COPY_AND_ASSIGN(GlobalHandles);
283 }; 287 };
284 288
285 289
286 } } // namespace v8::internal 290 } } // namespace v8::internal
287 291
288 #endif // V8_GLOBAL_HANDLES_H_ 292 #endif // V8_GLOBAL_HANDLES_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/global-handles.cc » ('j') | src/global-handles.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698