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

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

Issue 10444137: Expose last seen heap object id via v8 public api. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: test was added Created 8 years, 6 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/heap-profiler.cc ('k') | src/profile-generator.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 642
643 void SnapshotGenerationFinished(); 643 void SnapshotGenerationFinished();
644 SnapshotObjectId FindEntry(Address addr); 644 SnapshotObjectId FindEntry(Address addr);
645 SnapshotObjectId FindOrAddEntry(Address addr, unsigned int size); 645 SnapshotObjectId FindOrAddEntry(Address addr, unsigned int size);
646 void MoveObject(Address from, Address to); 646 void MoveObject(Address from, Address to);
647 SnapshotObjectId last_assigned_id() const { 647 SnapshotObjectId last_assigned_id() const {
648 return next_id_ - kObjectIdStep; 648 return next_id_ - kObjectIdStep;
649 } 649 }
650 650
651 void StopHeapObjectsTracking(); 651 void StopHeapObjectsTracking();
652 void PushHeapObjectsStats(OutputStream* stream); 652 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
653 653
654 static SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info); 654 static SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info);
655 static inline SnapshotObjectId GetNthGcSubrootId(int delta); 655 static inline SnapshotObjectId GetNthGcSubrootId(int delta);
656 656
657 static const int kObjectIdStep = 2; 657 static const int kObjectIdStep = 2;
658 static const SnapshotObjectId kInternalRootObjectId; 658 static const SnapshotObjectId kInternalRootObjectId;
659 static const SnapshotObjectId kGcRootsObjectId; 659 static const SnapshotObjectId kGcRootsObjectId;
660 static const SnapshotObjectId kNativesRootObjectId; 660 static const SnapshotObjectId kNativesRootObjectId;
661 static const SnapshotObjectId kGcRootsFirstSubrootId; 661 static const SnapshotObjectId kGcRootsFirstSubrootId;
662 static const SnapshotObjectId kFirstAvailableObjectId; 662 static const SnapshotObjectId kFirstAvailableObjectId;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap); 700 DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap);
701 }; 701 };
702 702
703 703
704 class HeapSnapshotsCollection { 704 class HeapSnapshotsCollection {
705 public: 705 public:
706 HeapSnapshotsCollection(); 706 HeapSnapshotsCollection();
707 ~HeapSnapshotsCollection(); 707 ~HeapSnapshotsCollection();
708 708
709 bool is_tracking_objects() { return is_tracking_objects_; } 709 bool is_tracking_objects() { return is_tracking_objects_; }
710 void PushHeapObjectsStats(OutputStream* stream) { 710 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream) {
711 return ids_.PushHeapObjectsStats(stream); 711 return ids_.PushHeapObjectsStats(stream);
712 } 712 }
713 void StartHeapObjectsTracking() { is_tracking_objects_ = true; } 713 void StartHeapObjectsTracking() { is_tracking_objects_ = true; }
714 void StopHeapObjectsTracking() { ids_.StopHeapObjectsTracking(); } 714 void StopHeapObjectsTracking() { ids_.StopHeapObjectsTracking(); }
715 715
716 HeapSnapshot* NewSnapshot( 716 HeapSnapshot* NewSnapshot(
717 HeapSnapshot::Type type, const char* name, unsigned uid); 717 HeapSnapshot::Type type, const char* name, unsigned uid);
718 void SnapshotGenerationFinished(HeapSnapshot* snapshot); 718 void SnapshotGenerationFinished(HeapSnapshot* snapshot);
719 List<HeapSnapshot*>* snapshots() { return &snapshots_; } 719 List<HeapSnapshot*>* snapshots() { return &snapshots_; }
720 HeapSnapshot* GetSnapshot(unsigned uid); 720 HeapSnapshot* GetSnapshot(unsigned uid);
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 1092
1093 friend class HeapSnapshotJSONSerializerEnumerator; 1093 friend class HeapSnapshotJSONSerializerEnumerator;
1094 friend class HeapSnapshotJSONSerializerIterator; 1094 friend class HeapSnapshotJSONSerializerIterator;
1095 1095
1096 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); 1096 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer);
1097 }; 1097 };
1098 1098
1099 } } // namespace v8::internal 1099 } } // namespace v8::internal
1100 1100
1101 #endif // V8_PROFILE_GENERATOR_H_ 1101 #endif // V8_PROFILE_GENERATOR_H_
OLDNEW
« no previous file with comments | « src/heap-profiler.cc ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698