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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 if (profiler != NULL && profiler->is_profiling()) { \ | 42 if (profiler != NULL && profiler->is_profiling()) { \ |
43 profiler->call; \ | 43 profiler->call; \ |
44 } \ | 44 } \ |
45 } while (false) | 45 } while (false) |
46 | 46 |
47 class HeapProfiler { | 47 class HeapProfiler { |
48 public: | 48 public: |
49 static void SetUp(); | 49 static void SetUp(); |
50 static void TearDown(); | 50 static void TearDown(); |
51 | 51 |
| 52 static size_t GetMemorySizeUsedByProfiler(); |
| 53 |
52 static HeapSnapshot* TakeSnapshot(const char* name, | 54 static HeapSnapshot* TakeSnapshot(const char* name, |
53 int type, | 55 int type, |
54 v8::ActivityControl* control); | 56 v8::ActivityControl* control); |
55 static HeapSnapshot* TakeSnapshot(String* name, | 57 static HeapSnapshot* TakeSnapshot(String* name, |
56 int type, | 58 int type, |
57 v8::ActivityControl* control); | 59 v8::ActivityControl* control); |
58 | 60 |
59 static void StartHeapObjectsTracking(); | 61 static void StartHeapObjectsTracking(); |
60 static void StopHeapObjectsTracking(); | 62 static void StopHeapObjectsTracking(); |
61 static SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); | 63 static SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); |
(...skipping 30 matching lines...) Expand all Loading... |
92 SnapshotObjectId PushHeapObjectsStatsImpl(OutputStream* stream); | 94 SnapshotObjectId PushHeapObjectsStatsImpl(OutputStream* stream); |
93 | 95 |
94 HeapSnapshotsCollection* snapshots_; | 96 HeapSnapshotsCollection* snapshots_; |
95 unsigned next_snapshot_uid_; | 97 unsigned next_snapshot_uid_; |
96 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 98 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
97 }; | 99 }; |
98 | 100 |
99 } } // namespace v8::internal | 101 } } // namespace v8::internal |
100 | 102 |
101 #endif // V8_HEAP_PROFILER_H_ | 103 #endif // V8_HEAP_PROFILER_H_ |
OLD | NEW |