| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 int children_count() const { return children_count_; } | 126 int children_count() const { return children_count_; } |
| 127 INLINE(int set_children_index(int index)); | 127 INLINE(int set_children_index(int index)); |
| 128 void add_child(HeapGraphEdge* edge) { | 128 void add_child(HeapGraphEdge* edge) { |
| 129 children_arr()[children_count_++] = edge; | 129 children_arr()[children_count_++] = edge; |
| 130 } | 130 } |
| 131 Vector<HeapGraphEdge*> children() { | 131 Vector<HeapGraphEdge*> children() { |
| 132 return Vector<HeapGraphEdge*>(children_arr(), children_count_); } | 132 return Vector<HeapGraphEdge*>(children_arr(), children_count_); } |
| 133 | 133 |
| 134 void SetIndexedReference( | 134 void SetIndexedReference( |
| 135 HeapGraphEdge::Type type, int index, HeapEntry* entry); | 135 HeapGraphEdge::Type type, int index, HeapEntry* entry); |
| 136 void SetIndexedAutoIndexReference( |
| 137 HeapGraphEdge::Type type, HeapEntry* child_entry); |
| 136 void SetNamedReference( | 138 void SetNamedReference( |
| 137 HeapGraphEdge::Type type, const char* name, HeapEntry* entry); | 139 HeapGraphEdge::Type type, const char* name, HeapEntry* entry); |
| 140 void SetNamedAutoIndexReference(HeapGraphEdge::Type type, |
| 141 HeapEntry* child_entry, |
| 142 StringsStorage* names); |
| 138 | 143 |
| 139 void Print( | 144 void Print( |
| 140 const char* prefix, const char* edge_name, int max_depth, int indent); | 145 const char* prefix, const char* edge_name, int max_depth, int indent); |
| 141 | 146 |
| 142 private: | 147 private: |
| 143 INLINE(HeapGraphEdge** children_arr()); | 148 INLINE(HeapGraphEdge** children_arr()); |
| 144 const char* TypeAsString(); | 149 const char* TypeAsString(); |
| 145 | 150 |
| 146 unsigned type_: 4; | 151 unsigned type_: 4; |
| 147 int children_count_: 28; | 152 int children_count_: 28; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 345 |
| 341 // An interface used to populate a snapshot with nodes and edges. | 346 // An interface used to populate a snapshot with nodes and edges. |
| 342 class SnapshotFillerInterface { | 347 class SnapshotFillerInterface { |
| 343 public: | 348 public: |
| 344 virtual ~SnapshotFillerInterface() { } | 349 virtual ~SnapshotFillerInterface() { } |
| 345 virtual HeapEntry* AddEntry(HeapThing ptr, | 350 virtual HeapEntry* AddEntry(HeapThing ptr, |
| 346 HeapEntriesAllocator* allocator) = 0; | 351 HeapEntriesAllocator* allocator) = 0; |
| 347 virtual HeapEntry* FindEntry(HeapThing ptr) = 0; | 352 virtual HeapEntry* FindEntry(HeapThing ptr) = 0; |
| 348 virtual HeapEntry* FindOrAddEntry(HeapThing ptr, | 353 virtual HeapEntry* FindOrAddEntry(HeapThing ptr, |
| 349 HeapEntriesAllocator* allocator) = 0; | 354 HeapEntriesAllocator* allocator) = 0; |
| 350 virtual void SetIndexedReference(HeapGraphEdge::Type type, | |
| 351 int parent_entry, | |
| 352 int index, | |
| 353 HeapEntry* child_entry) = 0; | |
| 354 virtual void SetIndexedAutoIndexReference(HeapGraphEdge::Type type, | |
| 355 int parent_entry, | |
| 356 HeapEntry* child_entry) = 0; | |
| 357 virtual void SetNamedReference(HeapGraphEdge::Type type, | |
| 358 int parent_entry, | |
| 359 const char* reference_name, | |
| 360 HeapEntry* child_entry) = 0; | |
| 361 virtual void SetNamedAutoIndexReference(HeapGraphEdge::Type type, | |
| 362 int parent_entry, | |
| 363 HeapEntry* child_entry) = 0; | |
| 364 }; | 355 }; |
| 365 | 356 |
| 366 | 357 |
| 367 class SnapshottingProgressReportingInterface { | 358 class SnapshottingProgressReportingInterface { |
| 368 public: | 359 public: |
| 369 virtual ~SnapshottingProgressReportingInterface() { } | 360 virtual ~SnapshottingProgressReportingInterface() { } |
| 370 virtual void ProgressStep() = 0; | 361 virtual void ProgressStep() = 0; |
| 371 virtual bool ProgressReport(bool force) = 0; | 362 virtual bool ProgressReport(bool force) = 0; |
| 372 }; | 363 }; |
| 373 | 364 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 397 | 388 |
| 398 private: | 389 private: |
| 399 HeapEntry* AddEntry(HeapObject* object); | 390 HeapEntry* AddEntry(HeapObject* object); |
| 400 HeapEntry* AddEntry(HeapObject* object, | 391 HeapEntry* AddEntry(HeapObject* object, |
| 401 HeapEntry::Type type, | 392 HeapEntry::Type type, |
| 402 const char* name); | 393 const char* name); |
| 403 | 394 |
| 404 const char* GetSystemEntryName(HeapObject* object); | 395 const char* GetSystemEntryName(HeapObject* object); |
| 405 | 396 |
| 406 void ExtractReferences(HeapObject* obj); | 397 void ExtractReferences(HeapObject* obj); |
| 407 void ExtractJSGlobalProxyReferences(int entry, JSGlobalProxy* proxy); | 398 void ExtractJSGlobalProxyReferences(HeapEntry* entry, JSGlobalProxy* proxy); |
| 408 void ExtractJSObjectReferences(int entry, JSObject* js_obj); | 399 void ExtractJSObjectReferences(HeapEntry* entry, JSObject* js_obj); |
| 409 void ExtractStringReferences(int entry, String* obj); | 400 void ExtractStringReferences(HeapEntry* entry, String* obj); |
| 410 void ExtractContextReferences(int entry, Context* context); | 401 void ExtractContextReferences(HeapEntry* entry, Context* context); |
| 411 void ExtractMapReferences(int entry, Map* map); | 402 void ExtractMapReferences(HeapEntry* entry, Map* map); |
| 412 void ExtractSharedFunctionInfoReferences(int entry, | 403 void ExtractSharedFunctionInfoReferences(HeapEntry* entry, |
| 413 SharedFunctionInfo* shared); | 404 SharedFunctionInfo* shared); |
| 414 void ExtractScriptReferences(int entry, Script* script); | 405 void ExtractScriptReferences(HeapEntry* entry, Script* script); |
| 415 void ExtractAccessorPairReferences(int entry, AccessorPair* accessors); | 406 void ExtractAccessorPairReferences(HeapEntry* entry, AccessorPair* accessors); |
| 416 void ExtractCodeCacheReferences(int entry, CodeCache* code_cache); | 407 void ExtractCodeCacheReferences(HeapEntry* entry, CodeCache* code_cache); |
| 417 void ExtractCodeReferences(int entry, Code* code); | 408 void ExtractCodeReferences(HeapEntry* entry, Code* code); |
| 418 void ExtractBoxReferences(int entry, Box* box); | 409 void ExtractBoxReferences(HeapEntry* entry, Box* box); |
| 419 void ExtractCellReferences(int entry, Cell* cell); | 410 void ExtractCellReferences(HeapEntry* entry, Cell* cell); |
| 420 void ExtractPropertyCellReferences(int entry, PropertyCell* cell); | 411 void ExtractPropertyCellReferences(HeapEntry* entry, PropertyCell* cell); |
| 421 void ExtractAllocationSiteReferences(int entry, AllocationSite* site); | 412 void ExtractAllocationSiteReferences(HeapEntry* entry, AllocationSite* site); |
| 422 void ExtractJSArrayBufferReferences(int entry, JSArrayBuffer* buffer); | 413 void ExtractJSArrayBufferReferences(HeapEntry* entry, JSArrayBuffer* buffer); |
| 423 void ExtractClosureReferences(JSObject* js_obj, int entry); | 414 void ExtractClosureReferences(JSObject* js_obj, HeapEntry* entry); |
| 424 void ExtractPropertyReferences(JSObject* js_obj, int entry); | 415 void ExtractPropertyReferences(JSObject* js_obj, HeapEntry* entry); |
| 425 bool ExtractAccessorPairProperty(JSObject* js_obj, int entry, | 416 bool ExtractAccessorPairProperty(JSObject* js_obj, HeapEntry* entry, |
| 426 Object* key, Object* callback_obj); | 417 Object* key, Object* callback_obj); |
| 427 void ExtractElementReferences(JSObject* js_obj, int entry); | 418 void ExtractElementReferences(JSObject* js_obj, HeapEntry* entry); |
| 428 void ExtractInternalReferences(JSObject* js_obj, int entry); | 419 void ExtractInternalReferences(JSObject* js_obj, HeapEntry* entry); |
| 429 bool IsEssentialObject(Object* object); | 420 bool IsEssentialObject(Object* object); |
| 430 void SetContextReference(HeapObject* parent_obj, | 421 void SetContextReference(HeapObject* parent_obj, |
| 431 int parent, | 422 HeapEntry* parent, |
| 432 String* reference_name, | 423 String* reference_name, |
| 433 Object* child, | 424 Object* child, |
| 434 int field_offset); | 425 int field_offset); |
| 435 void SetNativeBindReference(HeapObject* parent_obj, | 426 void SetNativeBindReference(HeapObject* parent_obj, |
| 436 int parent, | 427 HeapEntry* parent, |
| 437 const char* reference_name, | 428 const char* reference_name, |
| 438 Object* child); | 429 Object* child); |
| 439 void SetElementReference(HeapObject* parent_obj, | 430 void SetElementReference(HeapObject* parent_obj, |
| 440 int parent, | 431 HeapEntry* parent, |
| 441 int index, | 432 int index, |
| 442 Object* child); | 433 Object* child); |
| 443 void SetInternalReference(HeapObject* parent_obj, | 434 void SetInternalReference(HeapObject* parent_obj, |
| 444 int parent, | 435 HeapEntry* parent, |
| 445 const char* reference_name, | 436 const char* reference_name, |
| 446 Object* child, | 437 Object* child, |
| 447 int field_offset = -1); | 438 int field_offset = -1); |
| 448 void SetInternalReference(HeapObject* parent_obj, | 439 void SetInternalReference(HeapObject* parent_obj, |
| 449 int parent, | 440 HeapEntry* parent, |
| 450 int index, | 441 int index, |
| 451 Object* child, | 442 Object* child, |
| 452 int field_offset = -1); | 443 int field_offset = -1); |
| 453 void SetHiddenReference(HeapObject* parent_obj, | 444 void SetHiddenReference(HeapObject* parent_obj, |
| 454 int parent, | 445 HeapEntry* parent, |
| 455 int index, | 446 int index, |
| 456 Object* child); | 447 Object* child); |
| 457 void SetWeakReference(HeapObject* parent_obj, | 448 void SetWeakReference(HeapObject* parent_obj, |
| 458 int parent, | 449 HeapEntry* parent, |
| 459 const char* reference_name, | 450 const char* reference_name, |
| 460 Object* child_obj, | 451 Object* child_obj, |
| 461 int field_offset); | 452 int field_offset); |
| 462 void SetPropertyReference(HeapObject* parent_obj, | 453 void SetPropertyReference(HeapObject* parent_obj, |
| 463 int parent, | 454 HeapEntry* parent, |
| 464 Name* reference_name, | 455 Name* reference_name, |
| 465 Object* child, | 456 Object* child, |
| 466 const char* name_format_string = NULL, | 457 const char* name_format_string = NULL, |
| 467 int field_offset = -1); | 458 int field_offset = -1); |
| 468 void SetUserGlobalReference(Object* user_global); | 459 void SetUserGlobalReference(Object* user_global); |
| 469 void SetRootGcRootsReference(); | 460 void SetRootGcRootsReference(); |
| 470 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); | 461 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); |
| 471 void SetGcSubrootReference( | 462 void SetGcSubrootReference( |
| 472 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); | 463 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); |
| 473 const char* GetStrongGcSubrootName(Object* object); | 464 const char* GetStrongGcSubrootName(Object* object); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 friend class HeapSnapshotJSONSerializerEnumerator; | 633 friend class HeapSnapshotJSONSerializerEnumerator; |
| 643 friend class HeapSnapshotJSONSerializerIterator; | 634 friend class HeapSnapshotJSONSerializerIterator; |
| 644 | 635 |
| 645 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 636 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 646 }; | 637 }; |
| 647 | 638 |
| 648 | 639 |
| 649 } } // namespace v8::internal | 640 } } // namespace v8::internal |
| 650 | 641 |
| 651 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ | 642 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ |
| OLD | NEW |