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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 | 235 |
236 // Identify unmodified objects that are in weak state and marks them | 236 // Identify unmodified objects that are in weak state and marks them |
237 // unmodified | 237 // unmodified |
238 void IdentifyWeakUnmodifiedObjects(WeakSlotCallback is_unmodified); | 238 void IdentifyWeakUnmodifiedObjects(WeakSlotCallback is_unmodified); |
239 | 239 |
240 // Iterate over objects in object groups that have at least one object | 240 // Iterate over objects in object groups that have at least one object |
241 // which requires visiting. The callback has to return true if objects | 241 // which requires visiting. The callback has to return true if objects |
242 // can be skipped and false otherwise. | 242 // can be skipped and false otherwise. |
243 bool IterateObjectGroups(ObjectVisitor* v, WeakSlotCallbackWithHeap can_skip); | 243 bool IterateObjectGroups(ObjectVisitor* v, WeakSlotCallbackWithHeap can_skip); |
244 | 244 |
245 // Print all objects in object groups | |
246 void PrintObjectGroups(); | |
247 | |
245 // Add an object group. | 248 // Add an object group. |
246 // Should be only used in GC callback function before a collection. | 249 // Should be only used in GC callback function before a collection. |
247 // All groups are destroyed after a garbage collection. | 250 // All groups are destroyed after a garbage collection. |
248 void AddObjectGroup(Object*** handles, | 251 void AddObjectGroup(Object*** handles, |
249 size_t length, | 252 size_t length, |
250 v8::RetainedObjectInfo* info); | 253 v8::RetainedObjectInfo* info); |
251 | 254 |
252 // Associates handle with the object group represented by id. | 255 // Associates handle with the object group represented by id. |
253 // Should be only used in GC callback function before a collection. | 256 // Should be only used in GC callback function before a collection. |
254 // All groups are destroyed after a garbage collection. | 257 // All groups are destroyed after a garbage collection. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 | 351 |
349 // Object groups and implicit references, temporary representation while | 352 // Object groups and implicit references, temporary representation while |
350 // constructing the groups. | 353 // constructing the groups. |
351 List<ObjectGroupConnection> object_group_connections_; | 354 List<ObjectGroupConnection> object_group_connections_; |
352 List<ObjectGroupRetainerInfo> retainer_infos_; | 355 List<ObjectGroupRetainerInfo> retainer_infos_; |
353 List<ObjectGroupConnection> implicit_ref_connections_; | 356 List<ObjectGroupConnection> implicit_ref_connections_; |
354 | 357 |
355 List<PendingPhantomCallback> pending_phantom_callbacks_; | 358 List<PendingPhantomCallback> pending_phantom_callbacks_; |
356 | 359 |
357 friend class Isolate; | 360 friend class Isolate; |
361 friend class ObjectGroupsTracer; | |
ulan
2016/03/08 20:23:33
Not needed.
Marcel Hlopko
2016/03/09 09:30:30
Done.
| |
358 | 362 |
359 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); | 363 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
360 }; | 364 }; |
361 | 365 |
362 | 366 |
363 class GlobalHandles::PendingPhantomCallback { | 367 class GlobalHandles::PendingPhantomCallback { |
364 public: | 368 public: |
365 typedef v8::WeakCallbackInfo<void> Data; | 369 typedef v8::WeakCallbackInfo<void> Data; |
366 PendingPhantomCallback( | 370 PendingPhantomCallback( |
367 Node* node, Data::Callback callback, void* parameter, | 371 Node* node, Data::Callback callback, void* parameter, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
452 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; | 456 int singleton_handles_[NUMBER_OF_SINGLETON_HANDLES]; |
453 | 457 |
454 DISALLOW_COPY_AND_ASSIGN(EternalHandles); | 458 DISALLOW_COPY_AND_ASSIGN(EternalHandles); |
455 }; | 459 }; |
456 | 460 |
457 | 461 |
458 } // namespace internal | 462 } // namespace internal |
459 } // namespace v8 | 463 } // namespace v8 |
460 | 464 |
461 #endif // V8_GLOBAL_HANDLES_H_ | 465 #endif // V8_GLOBAL_HANDLES_H_ |
OLD | NEW |