OLD | NEW |
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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 INLINE(static uint32_t ObjectHash(const void* key)) { | 1065 INLINE(static uint32_t ObjectHash(const void* key)) { |
1066 return ComputeIntegerHash( | 1066 return ComputeIntegerHash( |
1067 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)), | 1067 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)), |
1068 v8::internal::kZeroHashSeed); | 1068 v8::internal::kZeroHashSeed); |
1069 } | 1069 } |
1070 | 1070 |
1071 HeapSnapshot* CreateFakeSnapshot(); | 1071 HeapSnapshot* CreateFakeSnapshot(); |
1072 int GetStringId(const char* s); | 1072 int GetStringId(const char* s); |
1073 int entry_index(HeapEntry* e) { return e->index() * kNodeFieldsCount; } | 1073 int entry_index(HeapEntry* e) { return e->index() * kNodeFieldsCount; } |
1074 void SerializeEdge(HeapGraphEdge* edge, bool first_edge); | 1074 void SerializeEdge(HeapGraphEdge* edge, bool first_edge); |
1075 void SerializeEdges(const List<HeapEntry>& nodes); | 1075 void SerializeEdges(); |
1076 void SerializeImpl(); | 1076 void SerializeImpl(); |
1077 void SerializeNode(HeapEntry* entry, int edges_index); | 1077 void SerializeNode(HeapEntry* entry); |
1078 void SerializeNodes(const List<HeapEntry>& nodes); | 1078 void SerializeNodes(); |
1079 void SerializeSnapshot(); | 1079 void SerializeSnapshot(); |
1080 void SerializeString(const unsigned char* s); | 1080 void SerializeString(const unsigned char* s); |
1081 void SerializeStrings(); | 1081 void SerializeStrings(); |
1082 void SortHashMap(HashMap* map, List<HashMap::Entry*>* sorted_entries); | 1082 void SortHashMap(HashMap* map, List<HashMap::Entry*>* sorted_entries); |
1083 | 1083 |
1084 static const int kEdgeFieldsCount; | 1084 static const int kEdgeFieldsCount; |
1085 static const int kNodeFieldsCount; | 1085 static const int kNodeFieldsCount; |
1086 | 1086 |
1087 HeapSnapshot* snapshot_; | 1087 HeapSnapshot* snapshot_; |
1088 HashMap strings_; | 1088 HashMap strings_; |
1089 int next_node_id_; | 1089 int next_node_id_; |
1090 int next_string_id_; | 1090 int next_string_id_; |
1091 OutputStreamWriter* writer_; | 1091 OutputStreamWriter* writer_; |
1092 | 1092 |
1093 friend class HeapSnapshotJSONSerializerEnumerator; | 1093 friend class HeapSnapshotJSONSerializerEnumerator; |
1094 friend class HeapSnapshotJSONSerializerIterator; | 1094 friend class HeapSnapshotJSONSerializerIterator; |
1095 | 1095 |
1096 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1096 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
1097 }; | 1097 }; |
1098 | 1098 |
1099 } } // namespace v8::internal | 1099 } } // namespace v8::internal |
1100 | 1100 |
1101 #endif // V8_PROFILE_GENERATOR_H_ | 1101 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |