| 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 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 INLINE(static uint32_t ObjectHash(const void* key)) { | 1140 INLINE(static uint32_t ObjectHash(const void* key)) { |
| 1141 return ComputeIntegerHash( | 1141 return ComputeIntegerHash( |
| 1142 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)), | 1142 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key)), |
| 1143 v8::internal::kZeroHashSeed); | 1143 v8::internal::kZeroHashSeed); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 HeapSnapshot* CreateFakeSnapshot(); | 1146 HeapSnapshot* CreateFakeSnapshot(); |
| 1147 int GetStringId(const char* s); | 1147 int GetStringId(const char* s); |
| 1148 void SerializeEdge(HeapGraphEdge* edge); | 1148 void SerializeEdge(HeapGraphEdge* edge, bool first_edge); |
| 1149 void SerializeEdges(const List<HeapEntry*>& nodes); |
| 1149 void SerializeImpl(); | 1150 void SerializeImpl(); |
| 1150 void SerializeNode(HeapEntry* entry); | 1151 void SerializeNode(HeapEntry* entry, int edges_index); |
| 1151 void SerializeNodes(); | 1152 void SerializeNodes(const List<HeapEntry*>& nodes); |
| 1152 void SerializeSnapshot(); | 1153 void SerializeSnapshot(); |
| 1153 void SerializeString(const unsigned char* s); | 1154 void SerializeString(const unsigned char* s); |
| 1154 void SerializeStrings(); | 1155 void SerializeStrings(); |
| 1155 void SortHashMap(HashMap* map, List<HashMap::Entry*>* sorted_entries); | 1156 void SortHashMap(HashMap* map, List<HashMap::Entry*>* sorted_entries); |
| 1156 | 1157 |
| 1157 static const int kMaxSerializableSnapshotRawSize; | 1158 static const int kMaxSerializableSnapshotRawSize; |
| 1158 | 1159 |
| 1159 HeapSnapshot* snapshot_; | 1160 HeapSnapshot* snapshot_; |
| 1160 HashMap strings_; | 1161 HashMap strings_; |
| 1161 int next_node_id_; | 1162 int next_node_id_; |
| 1162 int next_string_id_; | 1163 int next_string_id_; |
| 1163 OutputStreamWriter* writer_; | 1164 OutputStreamWriter* writer_; |
| 1164 | 1165 |
| 1165 friend class HeapSnapshotJSONSerializerEnumerator; | 1166 friend class HeapSnapshotJSONSerializerEnumerator; |
| 1166 friend class HeapSnapshotJSONSerializerIterator; | 1167 friend class HeapSnapshotJSONSerializerIterator; |
| 1167 | 1168 |
| 1168 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1169 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 1169 }; | 1170 }; |
| 1170 | 1171 |
| 1171 } } // namespace v8::internal | 1172 } } // namespace v8::internal |
| 1172 | 1173 |
| 1173 #endif // V8_PROFILE_GENERATOR_H_ | 1174 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |