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

Side by Side Diff: src/heap-profiler.cc

Issue 5139002: New heap profiler: include all heap objects and refs into snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years, 1 month 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
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 AllocatingRetainersIterator(const JSObjectsCluster& child_cluster, 920 AllocatingRetainersIterator(const JSObjectsCluster& child_cluster,
921 HeapEntriesMap* map) 921 HeapEntriesMap* map)
922 : child_(ClusterAsHeapObject(child_cluster)), map_(map) { 922 : child_(ClusterAsHeapObject(child_cluster)), map_(map) {
923 child_entry_ = map_->Map(child_); 923 child_entry_ = map_->Map(child_);
924 ASSERT(child_entry_ != NULL); 924 ASSERT(child_entry_ != NULL);
925 } 925 }
926 926
927 void Call(const JSObjectsCluster& cluster, 927 void Call(const JSObjectsCluster& cluster,
928 const NumberAndSizeInfo& number_and_size) { 928 const NumberAndSizeInfo& number_and_size) {
929 int child_index, retainer_index; 929 int child_index, retainer_index;
930 map_->CountReference(ClusterAsHeapObject(cluster), child_, 930 map_->CountReference(ClusterAsHeapObject(cluster),
931 &child_index, &retainer_index); 931 child_,
932 map_->Map(ClusterAsHeapObject(cluster))->SetElementReference( 932 &child_index,
933 child_index, number_and_size.number(), child_entry_, retainer_index); 933 &retainer_index);
934 map_->Map(ClusterAsHeapObject(cluster))->SetIndexedReference(
935 HeapGraphEdge::kElement,
936 child_index,
937 number_and_size.number(),
938 child_entry_,
939 retainer_index);
934 } 940 }
935 941
936 private: 942 private:
937 HeapObject* child_; 943 HeapObject* child_;
938 HeapEntriesMap* map_; 944 HeapEntriesMap* map_;
939 HeapEntry* child_entry_; 945 HeapEntry* child_entry_;
940 }; 946 };
941 947
942 948
943 template<class RetainersIterator> 949 template<class RetainersIterator>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 histogram_children_count, 1041 histogram_children_count,
1036 histogram_retainers_count); 1042 histogram_retainers_count);
1037 snapshot->AddEntry(HeapSnapshot::kInternalRootObject, 1043 snapshot->AddEntry(HeapSnapshot::kInternalRootObject,
1038 root_children_count, 1044 root_children_count,
1039 0); 1045 0);
1040 int root_child_index = 0; 1046 int root_child_index = 0;
1041 for (int i = FIRST_NONSTRING_TYPE; i <= kAllStringsType; ++i) { 1047 for (int i = FIRST_NONSTRING_TYPE; i <= kAllStringsType; ++i) {
1042 if (agg_snapshot_->info()[i].bytes() > 0) { 1048 if (agg_snapshot_->info()[i].bytes() > 0) {
1043 AddEntryFromAggregatedSnapshot(snapshot, 1049 AddEntryFromAggregatedSnapshot(snapshot,
1044 &root_child_index, 1050 &root_child_index,
1045 HeapEntry::kInternal, 1051 HeapEntry::kHidden,
1046 agg_snapshot_->info()[i].name(), 1052 agg_snapshot_->info()[i].name(),
1047 agg_snapshot_->info()[i].number(), 1053 agg_snapshot_->info()[i].number(),
1048 agg_snapshot_->info()[i].bytes(), 1054 agg_snapshot_->info()[i].bytes(),
1049 0, 1055 0,
1050 0); 1056 0);
1051 } 1057 }
1052 } 1058 }
1053 AllocatingConstructorHeapProfileIterator alloc_cons_iter( 1059 AllocatingConstructorHeapProfileIterator alloc_cons_iter(
1054 snapshot, &root_child_index); 1060 snapshot, &root_child_index);
1055 agg_snapshot_->js_cons_profile()->ForEach(&alloc_cons_iter); 1061 agg_snapshot_->js_cons_profile()->ForEach(&alloc_cons_iter);
(...skipping 30 matching lines...) Expand all
1086 GlobalHandles::MakeWeak(handle.location(), 1092 GlobalHandles::MakeWeak(handle.location(),
1087 static_cast<void*>(stack.start()), 1093 static_cast<void*>(stack.start()),
1088 StackWeakReferenceCallback); 1094 StackWeakReferenceCallback);
1089 } 1095 }
1090 1096
1091 1097
1092 #endif // ENABLE_LOGGING_AND_PROFILING 1098 #endif // ENABLE_LOGGING_AND_PROFILING
1093 1099
1094 1100
1095 } } // namespace v8::internal 1101 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/profile-generator.h » ('j') | src/profile-generator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698