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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 struct TimeInterval { | 259 struct TimeInterval { |
260 explicit TimeInterval(SnapshotObjectId id) : id(id), size(0), count(0) { } | 260 explicit TimeInterval(SnapshotObjectId id) : id(id), size(0), count(0) { } |
261 SnapshotObjectId id; | 261 SnapshotObjectId id; |
262 uint32_t size; | 262 uint32_t size; |
263 uint32_t count; | 263 uint32_t count; |
264 }; | 264 }; |
265 | 265 |
266 void UpdateHeapObjectsMap(); | 266 void UpdateHeapObjectsMap(); |
267 void RemoveDeadEntries(); | 267 void RemoveDeadEntries(); |
268 | 268 |
| 269 static bool AddressesMatch(void* key1, void* key2) { |
| 270 return key1 == key2; |
| 271 } |
| 272 |
| 273 static uint32_t AddressHash(Address addr) { |
| 274 return ComputeIntegerHash( |
| 275 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(addr)), |
| 276 v8::internal::kZeroHashSeed); |
| 277 } |
| 278 |
269 SnapshotObjectId next_id_; | 279 SnapshotObjectId next_id_; |
270 HashMap entries_map_; | 280 HashMap entries_map_; |
271 List<EntryInfo> entries_; | 281 List<EntryInfo> entries_; |
272 List<TimeInterval> time_intervals_; | 282 List<TimeInterval> time_intervals_; |
273 Heap* heap_; | 283 Heap* heap_; |
274 | 284 |
275 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap); | 285 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap); |
276 }; | 286 }; |
277 | 287 |
278 | 288 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 friend class HeapSnapshotJSONSerializerIterator; | 678 friend class HeapSnapshotJSONSerializerIterator; |
669 | 679 |
670 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 680 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
671 }; | 681 }; |
672 | 682 |
673 | 683 |
674 } } // namespace v8::internal | 684 } } // namespace v8::internal |
675 | 685 |
676 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ | 686 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ |
677 | 687 |
OLD | NEW |