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

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

Issue 22852024: Track JS allocations as they arrive with no affection on performance when tracking is switched off (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix style + rebase Created 7 years, 2 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.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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const char* name, 56 const char* name,
57 v8::ActivityControl* control, 57 v8::ActivityControl* control,
58 v8::HeapProfiler::ObjectNameResolver* resolver); 58 v8::HeapProfiler::ObjectNameResolver* resolver);
59 HeapSnapshot* TakeSnapshot( 59 HeapSnapshot* TakeSnapshot(
60 String* name, 60 String* name,
61 v8::ActivityControl* control, 61 v8::ActivityControl* control,
62 v8::HeapProfiler::ObjectNameResolver* resolver); 62 v8::HeapProfiler::ObjectNameResolver* resolver);
63 63
64 void StartHeapObjectsTracking(); 64 void StartHeapObjectsTracking();
65 void StopHeapObjectsTracking(); 65 void StopHeapObjectsTracking();
66
67 static void RecordObjectAllocationFromMasm(Isolate* isolate,
68 Address obj,
69 int size);
70
66 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); 71 SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
67 int GetSnapshotsCount(); 72 int GetSnapshotsCount();
68 HeapSnapshot* GetSnapshot(int index); 73 HeapSnapshot* GetSnapshot(int index);
69 SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj); 74 SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj);
70 void DeleteAllSnapshots(); 75 void DeleteAllSnapshots();
71 76
72 void ObjectMoveEvent(Address from, Address to); 77 void ObjectMoveEvent(Address from, Address to, int size);
78
79 void NewObjectEvent(Address addr, int size);
80
81 void UpdateObjectSizeEvent(Address addr, int size);
73 82
74 void DefineWrapperClass( 83 void DefineWrapperClass(
75 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); 84 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback);
76 85
77 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, 86 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id,
78 Object** wrapper); 87 Object** wrapper);
79 INLINE(bool is_profiling()) { 88 INLINE(bool is_profiling()) {
80 return snapshots_->is_tracking_objects(); 89 return snapshots_->is_tracking_objects();
81 } 90 }
82 91
83 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); 92 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info);
84 93
94 bool is_tracking_allocations() {
95 return is_tracking_allocations_;
96 }
97
98 void StartHeapAllocationsRecording();
99 void StopHeapAllocationsRecording();
100
101 int FindUntrackedObjects() {
102 return snapshots_->FindUntrackedObjects();
103 }
104
105 void DropCompiledCode();
106
85 private: 107 private:
86 Heap* heap() const { return snapshots_->heap(); } 108 Heap* heap() const { return snapshots_->heap(); }
87 109
88 HeapSnapshotsCollection* snapshots_; 110 HeapSnapshotsCollection* snapshots_;
89 unsigned next_snapshot_uid_; 111 unsigned next_snapshot_uid_;
90 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; 112 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_;
113 bool is_tracking_allocations_;
91 }; 114 };
92 115
93 } } // namespace v8::internal 116 } } // namespace v8::internal
94 117
95 #endif // V8_HEAP_PROFILER_H_ 118 #endif // V8_HEAP_PROFILER_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698