OLD | NEW |
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #ifdef ENABLE_LOGGING_AND_PROFILING | 60 #ifdef ENABLE_LOGGING_AND_PROFILING |
61 static HeapSnapshot* TakeSnapshot(const char* name, | 61 static HeapSnapshot* TakeSnapshot(const char* name, |
62 int type, | 62 int type, |
63 v8::ActivityControl* control); | 63 v8::ActivityControl* control); |
64 static HeapSnapshot* TakeSnapshot(String* name, | 64 static HeapSnapshot* TakeSnapshot(String* name, |
65 int type, | 65 int type, |
66 v8::ActivityControl* control); | 66 v8::ActivityControl* control); |
67 static int GetSnapshotsCount(); | 67 static int GetSnapshotsCount(); |
68 static HeapSnapshot* GetSnapshot(int index); | 68 static HeapSnapshot* GetSnapshot(int index); |
69 static HeapSnapshot* FindSnapshot(unsigned uid); | 69 static HeapSnapshot* FindSnapshot(unsigned uid); |
| 70 static void DeleteAllSnapshots(); |
70 | 71 |
71 void ObjectMoveEvent(Address from, Address to); | 72 void ObjectMoveEvent(Address from, Address to); |
72 | 73 |
73 void DefineWrapperClass( | 74 void DefineWrapperClass( |
74 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); | 75 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); |
75 | 76 |
76 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, | 77 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, |
77 Object** wrapper); | 78 Object** wrapper); |
78 INLINE(bool is_profiling()) { | 79 INLINE(bool is_profiling()) { |
79 return snapshots_->is_tracking_objects(); | 80 return snapshots_->is_tracking_objects(); |
80 } | 81 } |
81 | 82 |
82 // Obsolete interface. | 83 // Obsolete interface. |
83 // Write a single heap sample to the log file. | 84 // Write a single heap sample to the log file. |
84 static void WriteSample(); | 85 static void WriteSample(); |
85 | 86 |
86 private: | 87 private: |
87 HeapProfiler(); | 88 HeapProfiler(); |
88 ~HeapProfiler(); | 89 ~HeapProfiler(); |
89 HeapSnapshot* TakeSnapshotImpl(const char* name, | 90 HeapSnapshot* TakeSnapshotImpl(const char* name, |
90 int type, | 91 int type, |
91 v8::ActivityControl* control); | 92 v8::ActivityControl* control); |
92 HeapSnapshot* TakeSnapshotImpl(String* name, | 93 HeapSnapshot* TakeSnapshotImpl(String* name, |
93 int type, | 94 int type, |
94 v8::ActivityControl* control); | 95 v8::ActivityControl* control); |
| 96 void ResetSnapshots(); |
95 | 97 |
96 HeapSnapshotsCollection* snapshots_; | 98 HeapSnapshotsCollection* snapshots_; |
97 unsigned next_snapshot_uid_; | 99 unsigned next_snapshot_uid_; |
98 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 100 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
99 | 101 |
100 #endif // ENABLE_LOGGING_AND_PROFILING | 102 #endif // ENABLE_LOGGING_AND_PROFILING |
101 }; | 103 }; |
102 | 104 |
103 | 105 |
104 #ifdef ENABLE_LOGGING_AND_PROFILING | 106 #ifdef ENABLE_LOGGING_AND_PROFILING |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 friend class Isolate; | 387 friend class Isolate; |
386 | 388 |
387 DISALLOW_COPY_AND_ASSIGN(ProducerHeapProfile); | 389 DISALLOW_COPY_AND_ASSIGN(ProducerHeapProfile); |
388 }; | 390 }; |
389 | 391 |
390 #endif // ENABLE_LOGGING_AND_PROFILING | 392 #endif // ENABLE_LOGGING_AND_PROFILING |
391 | 393 |
392 } } // namespace v8::internal | 394 } } // namespace v8::internal |
393 | 395 |
394 #endif // V8_HEAP_PROFILER_H_ | 396 #endif // V8_HEAP_PROFILER_H_ |
OLD | NEW |