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 30 matching lines...) Expand all Loading... |
41 v8::internal::HeapProfiler* profiler = heap->isolate()->heap_profiler(); \ | 41 v8::internal::HeapProfiler* profiler = heap->isolate()->heap_profiler(); \ |
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 // The HeapProfiler writes data to the log files, which can be postprocessed | 47 // The HeapProfiler writes data to the log files, which can be postprocessed |
48 // to generate .hp files for use by the GHC/Valgrind tool hp2ps. | 48 // to generate .hp files for use by the GHC/Valgrind tool hp2ps. |
49 class HeapProfiler { | 49 class HeapProfiler { |
50 public: | 50 public: |
51 static void Setup(); | 51 static void SetUp(); |
52 static void TearDown(); | 52 static void TearDown(); |
53 | 53 |
54 static HeapSnapshot* TakeSnapshot(const char* name, | 54 static HeapSnapshot* TakeSnapshot(const char* name, |
55 int type, | 55 int type, |
56 v8::ActivityControl* control); | 56 v8::ActivityControl* control); |
57 static HeapSnapshot* TakeSnapshot(String* name, | 57 static HeapSnapshot* TakeSnapshot(String* name, |
58 int type, | 58 int type, |
59 v8::ActivityControl* control); | 59 v8::ActivityControl* control); |
60 static int GetSnapshotsCount(); | 60 static int GetSnapshotsCount(); |
61 static HeapSnapshot* GetSnapshot(int index); | 61 static HeapSnapshot* GetSnapshot(int index); |
(...skipping 23 matching lines...) Expand all Loading... |
85 void ResetSnapshots(); | 85 void ResetSnapshots(); |
86 | 86 |
87 HeapSnapshotsCollection* snapshots_; | 87 HeapSnapshotsCollection* snapshots_; |
88 unsigned next_snapshot_uid_; | 88 unsigned next_snapshot_uid_; |
89 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 89 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
90 }; | 90 }; |
91 | 91 |
92 } } // namespace v8::internal | 92 } } // namespace v8::internal |
93 | 93 |
94 #endif // V8_HEAP_PROFILER_H_ | 94 #endif // V8_HEAP_PROFILER_H_ |
OLD | NEW |