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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 int GetStringId(const char* s); | 651 int GetStringId(const char* s); |
652 int entry_index(HeapEntry* e) { return e->index() * kNodeFieldsCount; } | 652 int entry_index(HeapEntry* e) { return e->index() * kNodeFieldsCount; } |
653 void SerializeEdge(HeapGraphEdge* edge, bool first_edge); | 653 void SerializeEdge(HeapGraphEdge* edge, bool first_edge); |
654 void SerializeEdges(); | 654 void SerializeEdges(); |
655 void SerializeImpl(); | 655 void SerializeImpl(); |
656 void SerializeNode(HeapEntry* entry); | 656 void SerializeNode(HeapEntry* entry); |
657 void SerializeNodes(); | 657 void SerializeNodes(); |
658 void SerializeSnapshot(); | 658 void SerializeSnapshot(); |
659 void SerializeString(const unsigned char* s); | 659 void SerializeString(const unsigned char* s); |
660 void SerializeStrings(); | 660 void SerializeStrings(); |
661 void SortHashMap(HashMap* map, List<HashMap::Entry*>* sorted_entries); | |
662 | 661 |
663 static const int kEdgeFieldsCount; | 662 static const int kEdgeFieldsCount; |
664 static const int kNodeFieldsCount; | 663 static const int kNodeFieldsCount; |
665 | 664 |
666 HeapSnapshot* snapshot_; | 665 HeapSnapshot* snapshot_; |
667 HashMap strings_; | 666 HashMap strings_; |
668 int next_node_id_; | 667 int next_node_id_; |
669 int next_string_id_; | 668 int next_string_id_; |
670 OutputStreamWriter* writer_; | 669 OutputStreamWriter* writer_; |
671 | 670 |
672 friend class HeapSnapshotJSONSerializerEnumerator; | 671 friend class HeapSnapshotJSONSerializerEnumerator; |
673 friend class HeapSnapshotJSONSerializerIterator; | 672 friend class HeapSnapshotJSONSerializerIterator; |
674 | 673 |
675 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 674 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
676 }; | 675 }; |
677 | 676 |
678 | 677 |
679 } } // namespace v8::internal | 678 } } // namespace v8::internal |
680 | 679 |
681 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ | 680 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ |
682 | 681 |
OLD | NEW |