Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: src/heap-snapshot-generator.h

Issue 22300005: Use standard routine to compute pointer hashs in heap profiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698