| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 children_count, | 1312 children_count, |
| 1313 retainers_count); | 1313 retainers_count); |
| 1314 } else if (object->IsCode()) { | 1314 } else if (object->IsCode()) { |
| 1315 return AddEntry(object, | 1315 return AddEntry(object, |
| 1316 HeapEntry::kCode, | 1316 HeapEntry::kCode, |
| 1317 "", | 1317 "", |
| 1318 children_count, | 1318 children_count, |
| 1319 retainers_count); | 1319 retainers_count); |
| 1320 } else if (object->IsSharedFunctionInfo()) { | 1320 } else if (object->IsSharedFunctionInfo()) { |
| 1321 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); | 1321 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); |
| 1322 String* name = String::cast(shared->name())->length() > 0 ? | |
| 1323 String::cast(shared->name()) : shared->inferred_name(); | |
| 1324 return AddEntry(object, | 1322 return AddEntry(object, |
| 1325 HeapEntry::kCode, | 1323 HeapEntry::kCode, |
| 1326 collection_->GetFunctionName(name), | 1324 collection_->GetName(String::cast(shared->name())), |
| 1327 children_count, | 1325 children_count, |
| 1328 retainers_count); | 1326 retainers_count); |
| 1329 } else if (object->IsScript()) { | 1327 } else if (object->IsScript()) { |
| 1330 Script* script = Script::cast(object); | 1328 Script* script = Script::cast(object); |
| 1331 return AddEntry(object, | 1329 return AddEntry(object, |
| 1332 HeapEntry::kCode, | 1330 HeapEntry::kCode, |
| 1333 script->name()->IsString() ? | 1331 script->name()->IsString() ? |
| 1334 collection_->GetName(String::cast(script->name())) : "", | 1332 collection_->GetName(String::cast(script->name())) : "", |
| 1335 children_count, | 1333 children_count, |
| 1336 retainers_count); | 1334 retainers_count); |
| (...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2548 void HeapSnapshotJSONSerializer::SortHashMap( | 2546 void HeapSnapshotJSONSerializer::SortHashMap( |
| 2549 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 2547 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
| 2550 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 2548 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
| 2551 sorted_entries->Add(p); | 2549 sorted_entries->Add(p); |
| 2552 sorted_entries->Sort(SortUsingEntryValue); | 2550 sorted_entries->Sort(SortUsingEntryValue); |
| 2553 } | 2551 } |
| 2554 | 2552 |
| 2555 } } // namespace v8::internal | 2553 } } // namespace v8::internal |
| 2556 | 2554 |
| 2557 #endif // ENABLE_LOGGING_AND_PROFILING | 2555 #endif // ENABLE_LOGGING_AND_PROFILING |
| OLD | NEW |