OLD | NEW |
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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 } | 1355 } |
1356 to_entry->value = reinterpret_cast<void*>(from_entry_info_index); | 1356 to_entry->value = reinterpret_cast<void*>(from_entry_info_index); |
1357 } | 1357 } |
1358 | 1358 |
1359 | 1359 |
1360 SnapshotObjectId HeapObjectsMap::FindEntry(Address addr) { | 1360 SnapshotObjectId HeapObjectsMap::FindEntry(Address addr) { |
1361 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), false); | 1361 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), false); |
1362 if (entry == NULL) return 0; | 1362 if (entry == NULL) return 0; |
1363 int entry_index = static_cast<int>(reinterpret_cast<intptr_t>(entry->value)); | 1363 int entry_index = static_cast<int>(reinterpret_cast<intptr_t>(entry->value)); |
1364 EntryInfo& entry_info = entries_->at(entry_index); | 1364 EntryInfo& entry_info = entries_->at(entry_index); |
1365 entry_info.accessed = true; | |
1366 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy()); | 1365 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy()); |
1367 return entry_info.id; | 1366 return entry_info.id; |
1368 } | 1367 } |
1369 | 1368 |
1370 | 1369 |
1371 SnapshotObjectId HeapObjectsMap::FindOrAddEntry(Address addr, | 1370 SnapshotObjectId HeapObjectsMap::FindOrAddEntry(Address addr, |
1372 unsigned int size) { | 1371 unsigned int size) { |
1373 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy()); | 1372 ASSERT(static_cast<uint32_t>(entries_->length()) > entries_map_.occupancy()); |
1374 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), true); | 1373 HashMap::Entry* entry = entries_map_.Lookup(addr, AddressHash(addr), true); |
1375 if (entry->value != NULL) { | 1374 if (entry->value != NULL) { |
(...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3900 | 3899 |
3901 | 3900 |
3902 void HeapSnapshotJSONSerializer::SortHashMap( | 3901 void HeapSnapshotJSONSerializer::SortHashMap( |
3903 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3902 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
3904 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3903 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
3905 sorted_entries->Add(p); | 3904 sorted_entries->Add(p); |
3906 sorted_entries->Sort(SortUsingEntryValue); | 3905 sorted_entries->Sort(SortUsingEntryValue); |
3907 } | 3906 } |
3908 | 3907 |
3909 } } // namespace v8::internal | 3908 } } // namespace v8::internal |
OLD | NEW |