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

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

Issue 18420019: Change the type of system root nodes in heap snapshot to kSynthetic (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 232
233 void HeapSnapshot::RememberLastJSObjectId() { 233 void HeapSnapshot::RememberLastJSObjectId() {
234 max_snapshot_js_object_id_ = collection_->last_assigned_id(); 234 max_snapshot_js_object_id_ = collection_->last_assigned_id();
235 } 235 }
236 236
237 237
238 HeapEntry* HeapSnapshot::AddRootEntry() { 238 HeapEntry* HeapSnapshot::AddRootEntry() {
239 ASSERT(root_index_ == HeapEntry::kNoEntry); 239 ASSERT(root_index_ == HeapEntry::kNoEntry);
240 ASSERT(entries_.is_empty()); // Root entry must be the first one. 240 ASSERT(entries_.is_empty()); // Root entry must be the first one.
241 HeapEntry* entry = AddEntry(HeapEntry::kObject, 241 HeapEntry* entry = AddEntry(HeapEntry::kSynthetic,
242 "", 242 "",
243 HeapObjectsMap::kInternalRootObjectId, 243 HeapObjectsMap::kInternalRootObjectId,
244 0); 244 0);
245 root_index_ = entry->index(); 245 root_index_ = entry->index();
246 ASSERT(root_index_ == 0); 246 ASSERT(root_index_ == 0);
247 return entry; 247 return entry;
248 } 248 }
249 249
250 250
251 HeapEntry* HeapSnapshot::AddGcRootsEntry() { 251 HeapEntry* HeapSnapshot::AddGcRootsEntry() {
252 ASSERT(gc_roots_index_ == HeapEntry::kNoEntry); 252 ASSERT(gc_roots_index_ == HeapEntry::kNoEntry);
253 HeapEntry* entry = AddEntry(HeapEntry::kObject, 253 HeapEntry* entry = AddEntry(HeapEntry::kSynthetic,
254 "(GC roots)", 254 "(GC roots)",
255 HeapObjectsMap::kGcRootsObjectId, 255 HeapObjectsMap::kGcRootsObjectId,
256 0); 256 0);
257 gc_roots_index_ = entry->index(); 257 gc_roots_index_ = entry->index();
258 return entry; 258 return entry;
259 } 259 }
260 260
261 261
262 HeapEntry* HeapSnapshot::AddGcSubrootEntry(int tag) { 262 HeapEntry* HeapSnapshot::AddGcSubrootEntry(int tag) {
263 ASSERT(gc_subroot_indexes_[tag] == HeapEntry::kNoEntry); 263 ASSERT(gc_subroot_indexes_[tag] == HeapEntry::kNoEntry);
264 ASSERT(0 <= tag && tag < VisitorSynchronization::kNumberOfSyncTags); 264 ASSERT(0 <= tag && tag < VisitorSynchronization::kNumberOfSyncTags);
265 HeapEntry* entry = AddEntry( 265 HeapEntry* entry = AddEntry(
266 HeapEntry::kObject, 266 HeapEntry::kSynthetic,
267 VisitorSynchronization::kTagNames[tag], 267 VisitorSynchronization::kTagNames[tag],
268 HeapObjectsMap::GetNthGcSubrootId(tag), 268 HeapObjectsMap::GetNthGcSubrootId(tag),
269 0); 269 0);
270 gc_subroot_indexes_[tag] = entry->index(); 270 gc_subroot_indexes_[tag] = entry->index();
271 return entry; 271 return entry;
272 } 272 }
273 273
274 274
275 HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type, 275 HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type,
276 const char* name, 276 const char* name,
(...skipping 2417 matching lines...) Expand 10 before | Expand all | Expand 10 after
2694 2694
2695 2695
2696 void HeapSnapshotJSONSerializer::SortHashMap( 2696 void HeapSnapshotJSONSerializer::SortHashMap(
2697 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 2697 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
2698 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 2698 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
2699 sorted_entries->Add(p); 2699 sorted_entries->Add(p);
2700 sorted_entries->Sort(SortUsingEntryValue); 2700 sorted_entries->Sort(SortUsingEntryValue);
2701 } 2701 }
2702 2702
2703 } } // namespace v8::internal 2703 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698