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 | |
279 SnapshotObjectId next_id_; | 269 SnapshotObjectId next_id_; |
280 HashMap entries_map_; | 270 HashMap entries_map_; |
281 List<EntryInfo> entries_; | 271 List<EntryInfo> entries_; |
282 List<TimeInterval> time_intervals_; | 272 List<TimeInterval> time_intervals_; |
283 Heap* heap_; | 273 Heap* heap_; |
284 | 274 |
285 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap); | 275 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap); |
286 }; | 276 }; |
287 | 277 |
288 | 278 |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 friend class HeapSnapshotJSONSerializerIterator; | 668 friend class HeapSnapshotJSONSerializerIterator; |
679 | 669 |
680 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 670 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
681 }; | 671 }; |
682 | 672 |
683 | 673 |
684 } } // namespace v8::internal | 674 } } // namespace v8::internal |
685 | 675 |
686 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ | 676 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ |
687 | 677 |
OLD | NEW |