OLD | NEW |
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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 delete *snapshot_ptr; | 745 delete *snapshot_ptr; |
746 } | 746 } |
747 | 747 |
748 | 748 |
749 HeapSnapshotsCollection::~HeapSnapshotsCollection() { | 749 HeapSnapshotsCollection::~HeapSnapshotsCollection() { |
750 delete allocation_tracker_; | 750 delete allocation_tracker_; |
751 snapshots_.Iterate(DeleteHeapSnapshot); | 751 snapshots_.Iterate(DeleteHeapSnapshot); |
752 } | 752 } |
753 | 753 |
754 | 754 |
755 void HeapSnapshotsCollection::StartHeapObjectsTracking() { | 755 void HeapSnapshotsCollection::StartHeapObjectsTracking(bool track_allocations) { |
756 ids_.UpdateHeapObjectsMap(); | 756 ids_.UpdateHeapObjectsMap(); |
757 if (allocation_tracker_ == NULL) { | 757 ASSERT(allocation_tracker_ == NULL); |
| 758 if (track_allocations) { |
758 allocation_tracker_ = new AllocationTracker(&ids_, names()); | 759 allocation_tracker_ = new AllocationTracker(&ids_, names()); |
759 } | 760 } |
760 } | 761 } |
761 | 762 |
762 | 763 |
763 void HeapSnapshotsCollection::StopHeapObjectsTracking() { | 764 void HeapSnapshotsCollection::StopHeapObjectsTracking() { |
764 ids_.StopHeapObjectsTracking(); | 765 ids_.StopHeapObjectsTracking(); |
765 if (allocation_tracker_ != NULL) { | 766 if (allocation_tracker_ != NULL) { |
766 delete allocation_tracker_; | 767 delete allocation_tracker_; |
767 allocation_tracker_ = NULL; | 768 allocation_tracker_ = NULL; |
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3062 writer_->AddString("\"<dummy>\""); | 3063 writer_->AddString("\"<dummy>\""); |
3063 for (int i = 1; i < sorted_strings.length(); ++i) { | 3064 for (int i = 1; i < sorted_strings.length(); ++i) { |
3064 writer_->AddCharacter(','); | 3065 writer_->AddCharacter(','); |
3065 SerializeString(sorted_strings[i]); | 3066 SerializeString(sorted_strings[i]); |
3066 if (writer_->aborted()) return; | 3067 if (writer_->aborted()) return; |
3067 } | 3068 } |
3068 } | 3069 } |
3069 | 3070 |
3070 | 3071 |
3071 } } // namespace v8::internal | 3072 } } // namespace v8::internal |
OLD | NEW |