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

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

Issue 94993004: Move heap profiler state flags to HeapProfiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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/heap-snapshot-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 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 }; 287 };
288 288
289 289
290 class HeapSnapshotsCollection { 290 class HeapSnapshotsCollection {
291 public: 291 public:
292 explicit HeapSnapshotsCollection(Heap* heap); 292 explicit HeapSnapshotsCollection(Heap* heap);
293 ~HeapSnapshotsCollection(); 293 ~HeapSnapshotsCollection();
294 294
295 Heap* heap() const { return ids_.heap(); } 295 Heap* heap() const { return ids_.heap(); }
296 296
297 bool is_tracking_objects() { return is_tracking_objects_; }
298 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream) { 297 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream) {
299 return ids_.PushHeapObjectsStats(stream); 298 return ids_.PushHeapObjectsStats(stream);
300 } 299 }
301 void StartHeapObjectsTracking(); 300 void StartHeapObjectsTracking();
302 void StopHeapObjectsTracking(); 301 void StopHeapObjectsTracking();
303 302
304 HeapSnapshot* NewSnapshot(const char* name, unsigned uid); 303 HeapSnapshot* NewSnapshot(const char* name, unsigned uid);
305 void SnapshotGenerationFinished(HeapSnapshot* snapshot); 304 void SnapshotGenerationFinished(HeapSnapshot* snapshot);
306 List<HeapSnapshot*>* snapshots() { return &snapshots_; } 305 List<HeapSnapshot*>* snapshots() { return &snapshots_; }
307 void RemoveSnapshot(HeapSnapshot* snapshot); 306 void RemoveSnapshot(HeapSnapshot* snapshot);
(...skipping 15 matching lines...) Expand all
323 void UpdateObjectSizeEvent(Address addr, int size) { 322 void UpdateObjectSizeEvent(Address addr, int size) {
324 ids_.UpdateObjectSize(addr, size); 323 ids_.UpdateObjectSize(addr, size);
325 } 324 }
326 SnapshotObjectId last_assigned_id() const { 325 SnapshotObjectId last_assigned_id() const {
327 return ids_.last_assigned_id(); 326 return ids_.last_assigned_id();
328 } 327 }
329 size_t GetUsedMemorySize() const; 328 size_t GetUsedMemorySize() const;
330 329
331 int FindUntrackedObjects() { return ids_.FindUntrackedObjects(); } 330 int FindUntrackedObjects() { return ids_.FindUntrackedObjects(); }
332 331
333 void UpdateHeapObjectsMap() { ids_.UpdateHeapObjectsMap(); }
334
335 private: 332 private:
336 bool is_tracking_objects_; // Whether tracking object moves is needed.
337 List<HeapSnapshot*> snapshots_; 333 List<HeapSnapshot*> snapshots_;
338 StringsStorage names_; 334 StringsStorage names_;
339 // Mapping from HeapObject addresses to objects' uids. 335 // Mapping from HeapObject addresses to objects' uids.
340 HeapObjectsMap ids_; 336 HeapObjectsMap ids_;
341 AllocationTracker* allocation_tracker_; 337 AllocationTracker* allocation_tracker_;
342 338
343 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotsCollection); 339 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotsCollection);
344 }; 340 };
345 341
346 342
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 friend class HeapSnapshotJSONSerializerEnumerator; 693 friend class HeapSnapshotJSONSerializerEnumerator;
698 friend class HeapSnapshotJSONSerializerIterator; 694 friend class HeapSnapshotJSONSerializerIterator;
699 695
700 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); 696 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer);
701 }; 697 };
702 698
703 699
704 } } // namespace v8::internal 700 } } // namespace v8::internal
705 701
706 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ 702 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_
OLDNEW
« no previous file with comments | « src/heap-profiler.cc ('k') | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698