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

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

Issue 9858016: I'd like to add HeapSnapshot::GetMaxSnapshotJSObjectId function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix. In some cases v8_str doesn't introduce new string in the heap. As result both snapshot have eq… Created 8 years, 8 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/profile-generator.h ('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 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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 const char* title, 1126 const char* title,
1127 unsigned uid) 1127 unsigned uid)
1128 : collection_(collection), 1128 : collection_(collection),
1129 type_(type), 1129 type_(type),
1130 title_(title), 1130 title_(title),
1131 uid_(uid), 1131 uid_(uid),
1132 root_entry_(NULL), 1132 root_entry_(NULL),
1133 gc_roots_entry_(NULL), 1133 gc_roots_entry_(NULL),
1134 natives_root_entry_(NULL), 1134 natives_root_entry_(NULL),
1135 raw_entries_(NULL), 1135 raw_entries_(NULL),
1136 entries_sorted_(false) { 1136 entries_sorted_(false),
1137 max_snapshot_js_object_id_(0) {
1137 STATIC_CHECK( 1138 STATIC_CHECK(
1138 sizeof(HeapGraphEdge) == 1139 sizeof(HeapGraphEdge) ==
1139 SnapshotSizeConstants<kPointerSize>::kExpectedHeapGraphEdgeSize); 1140 SnapshotSizeConstants<kPointerSize>::kExpectedHeapGraphEdgeSize);
1140 STATIC_CHECK( 1141 STATIC_CHECK(
1141 sizeof(HeapEntry) == 1142 sizeof(HeapEntry) ==
1142 SnapshotSizeConstants<kPointerSize>::kExpectedHeapEntrySize); 1143 SnapshotSizeConstants<kPointerSize>::kExpectedHeapEntrySize);
1143 for (int i = 0; i < VisitorSynchronization::kNumberOfSyncTags; ++i) { 1144 for (int i = 0; i < VisitorSynchronization::kNumberOfSyncTags; ++i) {
1144 gc_subroot_entries_[i] = NULL; 1145 gc_subroot_entries_[i] = NULL;
1145 } 1146 }
1146 } 1147 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 1217
1217 1218
1218 HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type, 1219 HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type,
1219 const char* name, 1220 const char* name,
1220 SnapshotObjectId id, 1221 SnapshotObjectId id,
1221 int size, 1222 int size,
1222 int children_count, 1223 int children_count,
1223 int retainers_count) { 1224 int retainers_count) {
1224 HeapEntry* entry = GetNextEntryToInit(); 1225 HeapEntry* entry = GetNextEntryToInit();
1225 entry->Init(this, type, name, id, size, children_count, retainers_count); 1226 entry->Init(this, type, name, id, size, children_count, retainers_count);
1227
1228 // Track only js objects. They have odd ids.
1229 if (id % HeapObjectsMap::kObjectIdStep && id > max_snapshot_js_object_id_)
1230 max_snapshot_js_object_id_ = id;
1231
1226 return entry; 1232 return entry;
1227 } 1233 }
1228 1234
1229 1235
1230 void HeapSnapshot::SetDominatorsToSelf() { 1236 void HeapSnapshot::SetDominatorsToSelf() {
1231 for (int i = 0; i < entries_.length(); ++i) { 1237 for (int i = 0; i < entries_.length(); ++i) {
1232 HeapEntry* entry = entries_[i]; 1238 HeapEntry* entry = entries_[i];
1233 if (entry->dominator() == NULL) entry->set_dominator(entry); 1239 if (entry->dominator() == NULL) entry->set_dominator(entry);
1234 } 1240 }
1235 } 1241 }
(...skipping 2495 matching lines...) Expand 10 before | Expand all | Expand 10 after
3731 3737
3732 3738
3733 void HeapSnapshotJSONSerializer::SortHashMap( 3739 void HeapSnapshotJSONSerializer::SortHashMap(
3734 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 3740 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
3735 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 3741 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
3736 sorted_entries->Add(p); 3742 sorted_entries->Add(p);
3737 sorted_entries->Sort(SortUsingEntryValue); 3743 sorted_entries->Sort(SortUsingEntryValue);
3738 } 3744 }
3739 3745
3740 } } // namespace v8::internal 3746 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698