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

Side by Side Diff: src/profiler/heap-snapshot-generator.cc

Issue 2369963002: [base] Remove PointersMatch, making a separate std::equals hashmap (Closed)
Patch Set: Fix the other simulators Created 4 years, 2 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
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | src/profiler/profile-generator.h » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/profiler/heap-snapshot-generator.h" 5 #include "src/profiler/heap-snapshot-generator.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/objects-body-descriptors.h" 10 #include "src/objects-body-descriptors.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 // HeapObjectsMap::GenerateId) and odds for native objects. 348 // HeapObjectsMap::GenerateId) and odds for native objects.
349 const SnapshotObjectId HeapObjectsMap::kInternalRootObjectId = 1; 349 const SnapshotObjectId HeapObjectsMap::kInternalRootObjectId = 1;
350 const SnapshotObjectId HeapObjectsMap::kGcRootsObjectId = 350 const SnapshotObjectId HeapObjectsMap::kGcRootsObjectId =
351 HeapObjectsMap::kInternalRootObjectId + HeapObjectsMap::kObjectIdStep; 351 HeapObjectsMap::kInternalRootObjectId + HeapObjectsMap::kObjectIdStep;
352 const SnapshotObjectId HeapObjectsMap::kGcRootsFirstSubrootId = 352 const SnapshotObjectId HeapObjectsMap::kGcRootsFirstSubrootId =
353 HeapObjectsMap::kGcRootsObjectId + HeapObjectsMap::kObjectIdStep; 353 HeapObjectsMap::kGcRootsObjectId + HeapObjectsMap::kObjectIdStep;
354 const SnapshotObjectId HeapObjectsMap::kFirstAvailableObjectId = 354 const SnapshotObjectId HeapObjectsMap::kFirstAvailableObjectId =
355 HeapObjectsMap::kGcRootsFirstSubrootId + 355 HeapObjectsMap::kGcRootsFirstSubrootId +
356 VisitorSynchronization::kNumberOfSyncTags * HeapObjectsMap::kObjectIdStep; 356 VisitorSynchronization::kNumberOfSyncTags * HeapObjectsMap::kObjectIdStep;
357 357
358
359 static bool AddressesMatch(void* key1, void* key2) {
360 return key1 == key2;
361 }
362
363
364 HeapObjectsMap::HeapObjectsMap(Heap* heap) 358 HeapObjectsMap::HeapObjectsMap(Heap* heap)
365 : next_id_(kFirstAvailableObjectId), 359 : next_id_(kFirstAvailableObjectId), heap_(heap) {
366 entries_map_(AddressesMatch),
367 heap_(heap) {
368 // This dummy element solves a problem with entries_map_. 360 // This dummy element solves a problem with entries_map_.
369 // When we do lookup in HashMap we see no difference between two cases: 361 // When we do lookup in HashMap we see no difference between two cases:
370 // it has an entry with NULL as the value or it has created 362 // it has an entry with NULL as the value or it has created
371 // a new entry on the fly with NULL as the default value. 363 // a new entry on the fly with NULL as the default value.
372 // With such dummy element we have a guaranty that all entries_map_ entries 364 // With such dummy element we have a guaranty that all entries_map_ entries
373 // will have the value field grater than 0. 365 // will have the value field grater than 0.
374 // This fact is using in MoveObject method. 366 // This fact is using in MoveObject method.
375 entries_.Add(EntryInfo(0, NULL, 0)); 367 entries_.Add(EntryInfo(0, NULL, 0));
376 } 368 }
377 369
(...skipping 2744 matching lines...) Expand 10 before | Expand all | Expand 10 after
3122 for (int i = 1; i < sorted_strings.length(); ++i) { 3114 for (int i = 1; i < sorted_strings.length(); ++i) {
3123 writer_->AddCharacter(','); 3115 writer_->AddCharacter(',');
3124 SerializeString(sorted_strings[i]); 3116 SerializeString(sorted_strings[i]);
3125 if (writer_->aborted()) return; 3117 if (writer_->aborted()) return;
3126 } 3118 }
3127 } 3119 }
3128 3120
3129 3121
3130 } // namespace internal 3122 } // namespace internal
3131 } // namespace v8 3123 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.h ('k') | src/profiler/profile-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698