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

Side by Side Diff: src/heap-profiler.h

Issue 96933003: Simplify allocation tracker API (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/api.cc ('k') | src/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 2009-2010 the V8 project authors. All rights reserved. 1 // Copyright 2009-2010 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 HeapSnapshot* TakeSnapshot( 47 HeapSnapshot* TakeSnapshot(
48 const char* name, 48 const char* name,
49 v8::ActivityControl* control, 49 v8::ActivityControl* control,
50 v8::HeapProfiler::ObjectNameResolver* resolver); 50 v8::HeapProfiler::ObjectNameResolver* resolver);
51 HeapSnapshot* TakeSnapshot( 51 HeapSnapshot* TakeSnapshot(
52 String* name, 52 String* name,
53 v8::ActivityControl* control, 53 v8::ActivityControl* control,
54 v8::HeapProfiler::ObjectNameResolver* resolver); 54 v8::HeapProfiler::ObjectNameResolver* resolver);
55 55
56 void StartHeapObjectsTracking(); 56 void StartHeapObjectsTracking(bool track_allocations);
57 void StopHeapObjectsTracking(); 57 void StopHeapObjectsTracking();
58 58
59 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); 59 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
60 int GetSnapshotsCount(); 60 int GetSnapshotsCount();
61 HeapSnapshot* GetSnapshot(int index); 61 HeapSnapshot* GetSnapshot(int index);
62 SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj); 62 SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj);
63 void DeleteAllSnapshots(); 63 void DeleteAllSnapshots();
64 64
65 void ObjectMoveEvent(Address from, Address to, int size); 65 void ObjectMoveEvent(Address from, Address to, int size);
66 66
67 void AllocationEvent(Address addr, int size); 67 void AllocationEvent(Address addr, int size);
68 68
69 void UpdateObjectSizeEvent(Address addr, int size); 69 void UpdateObjectSizeEvent(Address addr, int size);
70 70
71 void DefineWrapperClass( 71 void DefineWrapperClass(
72 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); 72 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback);
73 73
74 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, 74 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id,
75 Object** wrapper); 75 Object** wrapper);
76 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); 76 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info);
77 77
78 bool is_tracking_object_moves() const { return is_tracking_object_moves_; } 78 bool is_tracking_object_moves() const { return is_tracking_object_moves_; }
79 bool is_tracking_allocations() const { return is_tracking_allocations_; } 79 bool is_tracking_allocations() const { return is_tracking_allocations_; }
80 80
81 void StartHeapAllocationsRecording();
82 void StopHeapAllocationsRecording();
83
84 int FindUntrackedObjects() { 81 int FindUntrackedObjects() {
85 return snapshots_->FindUntrackedObjects(); 82 return snapshots_->FindUntrackedObjects();
86 } 83 }
87 84
88 private: 85 private:
89 Heap* heap() const { return snapshots_->heap(); } 86 Heap* heap() const { return snapshots_->heap(); }
90 87
91 HeapSnapshotsCollection* snapshots_; 88 HeapSnapshotsCollection* snapshots_;
92 unsigned next_snapshot_uid_; 89 unsigned next_snapshot_uid_;
93 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; 90 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_;
94 bool is_tracking_allocations_; 91 bool is_tracking_allocations_;
95 bool is_tracking_object_moves_; 92 bool is_tracking_object_moves_;
96 }; 93 };
97 94
98 } } // namespace v8::internal 95 } } // namespace v8::internal
99 96
100 #endif // V8_HEAP_PROFILER_H_ 97 #endif // V8_HEAP_PROFILER_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698