Chromium Code Reviews| Index: src/profile-generator.cc |
| diff --git a/src/profile-generator.cc b/src/profile-generator.cc |
| index 2d0984ecbf36d4d09d9d687b11420320ce13ce25..f705473317d34b4ba9f5c78dbc7696dff0dd553c 100644 |
| --- a/src/profile-generator.cc |
| +++ b/src/profile-generator.cc |
| @@ -1133,7 +1133,8 @@ HeapSnapshot::HeapSnapshot(HeapSnapshotsCollection* collection, |
| gc_roots_entry_(NULL), |
| natives_root_entry_(NULL), |
| raw_entries_(NULL), |
| - entries_sorted_(false) { |
| + entries_sorted_(false), |
| + max_snapshot_js_object_id_(0) { |
| STATIC_CHECK( |
| sizeof(HeapGraphEdge) == |
| SnapshotSizeConstants<kPointerSize>::kExpectedHeapGraphEdgeSize); |
| @@ -1223,6 +1224,11 @@ HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type, |
| int retainers_count) { |
| HeapEntry* entry = GetNextEntryToInit(); |
| entry->Init(this, type, name, id, size, children_count, retainers_count); |
| + |
| + // Track only js objects. They have odd ids. |
| + if (id % 2 && id > max_snapshot_js_object_id_) |
|
mnaganov (inactive)
2012/03/26 15:55:37
Shouldn't you use HeapObjectMap::kObjectIdStep her
|
| + max_snapshot_js_object_id_ = id; |
| + |
| return entry; |
| } |