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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 static bool IsIndependent(Object** location); | 174 static bool IsIndependent(Object** location); |
175 | 175 |
176 // Tells whether global handle is near death. | 176 // Tells whether global handle is near death. |
177 static bool IsNearDeath(Object** location); | 177 static bool IsNearDeath(Object** location); |
178 | 178 |
179 // Tells whether global handle is weak. | 179 // Tells whether global handle is weak. |
180 static bool IsWeak(Object** location); | 180 static bool IsWeak(Object** location); |
181 | 181 |
182 // Process pending weak handles. | 182 // Process pending weak handles. |
183 // Returns the number of freed nodes. | 183 // Returns the number of freed nodes. |
184 int PostGarbageCollectionProcessing(GarbageCollector collector); | 184 int PostGarbageCollectionProcessing( |
| 185 GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags); |
185 | 186 |
186 // Iterates over all strong handles. | 187 // Iterates over all strong handles. |
187 void IterateStrongRoots(ObjectVisitor* v); | 188 void IterateStrongRoots(ObjectVisitor* v); |
188 | 189 |
189 // Iterates over all handles. | 190 // Iterates over all handles. |
190 void IterateAllRoots(ObjectVisitor* v); | 191 void IterateAllRoots(ObjectVisitor* v); |
191 | 192 |
192 // Iterates over all handles that have embedder-assigned class ID. | 193 // Iterates over all handles that have embedder-assigned class ID. |
193 void IterateAllRootsWithClassIds(ObjectVisitor* v); | 194 void IterateAllRootsWithClassIds(ObjectVisitor* v); |
194 | 195 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 281 |
281 // Migrates data from the internal representation (object_group_connections_, | 282 // Migrates data from the internal representation (object_group_connections_, |
282 // retainer_infos_ and implicit_ref_connections_) to the public and more | 283 // retainer_infos_ and implicit_ref_connections_) to the public and more |
283 // efficient representation (object_groups_ and implicit_ref_groups_). | 284 // efficient representation (object_groups_ and implicit_ref_groups_). |
284 void ComputeObjectGroupsAndImplicitReferences(); | 285 void ComputeObjectGroupsAndImplicitReferences(); |
285 | 286 |
286 // v8::internal::List is inefficient even for small number of elements, if we | 287 // v8::internal::List is inefficient even for small number of elements, if we |
287 // don't assign any initial capacity. | 288 // don't assign any initial capacity. |
288 static const int kObjectGroupConnectionsCapacity = 20; | 289 static const int kObjectGroupConnectionsCapacity = 20; |
289 | 290 |
| 291 class PendingPhantomCallback; |
| 292 |
290 // Helpers for PostGarbageCollectionProcessing. | 293 // Helpers for PostGarbageCollectionProcessing. |
| 294 static void InvokeSecondPassPhantomCallbacks( |
| 295 List<PendingPhantomCallback>* callbacks, Isolate* isolate); |
291 int PostScavengeProcessing(int initial_post_gc_processing_count); | 296 int PostScavengeProcessing(int initial_post_gc_processing_count); |
292 int PostMarkSweepProcessing(int initial_post_gc_processing_count); | 297 int PostMarkSweepProcessing(int initial_post_gc_processing_count); |
293 int DispatchPendingPhantomCallbacks(); | 298 int DispatchPendingPhantomCallbacks(bool synchronous_second_pass); |
294 void UpdateListOfNewSpaceNodes(); | 299 void UpdateListOfNewSpaceNodes(); |
295 | 300 |
296 // Internal node structures. | 301 // Internal node structures. |
297 class Node; | 302 class Node; |
298 class NodeBlock; | 303 class NodeBlock; |
299 class NodeIterator; | 304 class NodeIterator; |
300 class PendingPhantomCallback; | 305 class PendingPhantomCallbacksSecondPassTask; |
301 | 306 |
302 Isolate* isolate_; | 307 Isolate* isolate_; |
303 | 308 |
304 // Field always containing the number of handles to global objects. | 309 // Field always containing the number of handles to global objects. |
305 int number_of_global_handles_; | 310 int number_of_global_handles_; |
306 | 311 |
307 // List of all allocated node blocks. | 312 // List of all allocated node blocks. |
308 NodeBlock* first_block_; | 313 NodeBlock* first_block_; |
309 | 314 |
310 // List of node blocks with used nodes. | 315 // List of node blocks with used nodes. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 List<int> new_space_indices_; | 434 List<int> new_space_indices_; |
430 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; | 435 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; |
431 | 436 |
432 DISALLOW_COPY_AND_ASSIGN(EternalHandles); | 437 DISALLOW_COPY_AND_ASSIGN(EternalHandles); |
433 }; | 438 }; |
434 | 439 |
435 | 440 |
436 } } // namespace v8::internal | 441 } } // namespace v8::internal |
437 | 442 |
438 #endif // V8_GLOBAL_HANDLES_H_ | 443 #endif // V8_GLOBAL_HANDLES_H_ |
OLD | NEW |