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

Side by Side Diff: src/profile-generator.cc

Issue 10094011: Add method for resolving SnapshotObjectId by given object (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 8 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 | « src/profile-generator.h ('k') | test/cctest/test-heap-profiler.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1359 } 1359 }
1360 to_entry->value = reinterpret_cast<void*>(from_entry_info_index); 1360 to_entry->value = reinterpret_cast<void*>(from_entry_info_index);
1361 } 1361 }
1362 1362
1363 1363
1364 SnapshotObjectId HeapObjectsMap::FindEntry(Address addr) { 1364 SnapshotObjectId HeapObjectsMap::FindEntry(Address addr) {
1365 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), false); 1365 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), false);
1366 if (entry == NULL) return 0; 1366 if (entry == NULL) return 0;
1367 int entry_index = static_cast<int>(reinterpret_cast<intptr_t>(entry->value)); 1367 int entry_index = static_cast<int>(reinterpret_cast<intptr_t>(entry->value));
1368 EntryInfo& entry_info = entries_->at(entry_index); 1368 EntryInfo& entry_info = entries_->at(entry_index);
1369 entry_info.accessed = true;
yurys 2012/04/16 13:04:38 HeapObjectsMap::FindEntry is only called by HeapSn
1370 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy()); 1369 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy());
1371 return entry_info.id; 1370 return entry_info.id;
1372 } 1371 }
1373 1372
1374 1373
1375 SnapshotObjectId HeapObjectsMap::FindOrAddEntry(Address addr, 1374 SnapshotObjectId HeapObjectsMap::FindOrAddEntry(Address addr,
1376 unsigned int size) { 1375 unsigned int size) {
1377 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy()); 1376 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy());
1378 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), true); 1377 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), true);
1379 if (entry->value != NULL) { 1378 if (entry->value != NULL) {
(...skipping 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 3859
3861 3860
3862 void HeapSnapshotJSONSerializer::SortHashMap( 3861 void HeapSnapshotJSONSerializer::SortHashMap(
3863 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 3862 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
3864 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 3863 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
3865 sorted_entries->Add(p); 3864 sorted_entries->Add(p);
3866 sorted_entries->Sort(SortUsingEntryValue); 3865 sorted_entries->Sort(SortUsingEntryValue);
3867 } 3866 }
3868 3867
3869 } } // namespace v8::internal 3868 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698