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

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

Issue 4040008: A little piece of code for aligning heap snapshots vs. object inspection. (Closed)
Patch Set: Created 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698