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

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

Issue 19397002: Provide named links to code objects in heap snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing edge type to GetName API. Wondering how it worked before??? Created 7 years, 5 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/api.cc ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 class IndexedReferencesExtractor : public ObjectVisitor { 887 class IndexedReferencesExtractor : public ObjectVisitor {
888 public: 888 public:
889 IndexedReferencesExtractor(V8HeapExplorer* generator, 889 IndexedReferencesExtractor(V8HeapExplorer* generator,
890 HeapObject* parent_obj, 890 HeapObject* parent_obj,
891 int parent) 891 int parent)
892 : generator_(generator), 892 : generator_(generator),
893 parent_obj_(parent_obj), 893 parent_obj_(parent_obj),
894 parent_(parent), 894 parent_(parent),
895 next_index_(1) { 895 next_index_(1) {
896 } 896 }
897 void VisitCodeEntry(Address entry_address) {
898 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
899 generator_->SetInternalReference(parent_obj_, parent_, "code", code);
900 generator_->TagObject(code, "(code)");
901 }
897 void VisitPointers(Object** start, Object** end) { 902 void VisitPointers(Object** start, Object** end) {
898 for (Object** p = start; p < end; p++) { 903 for (Object** p = start; p < end; p++) {
899 if (CheckVisitedAndUnmark(p)) continue; 904 if (CheckVisitedAndUnmark(p)) continue;
900 generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p); 905 generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p);
901 } 906 }
902 } 907 }
903 static void MarkVisitedField(HeapObject* obj, int offset) { 908 static void MarkVisitedField(HeapObject* obj, int offset) {
904 if (offset < 0) return; 909 if (offset < 0) return;
905 Address field = obj->address() + offset; 910 Address field = obj->address() + offset;
906 ASSERT(!Memory::Object_at(field)->IsFailure()); 911 ASSERT(!Memory::Object_at(field)->IsFailure());
(...skipping 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after
2680 2685
2681 2686
2682 void HeapSnapshotJSONSerializer::SortHashMap( 2687 void HeapSnapshotJSONSerializer::SortHashMap(
2683 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 2688 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
2684 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 2689 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
2685 sorted_entries->Add(p); 2690 sorted_entries->Add(p);
2686 sorted_entries->Sort(SortUsingEntryValue); 2691 sorted_entries->Sort(SortUsingEntryValue);
2687 } 2692 }
2688 2693
2689 } } // namespace v8::internal 2694 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698