| Index: src/heap-profiler.h
|
| diff --git a/src/heap-profiler.h b/src/heap-profiler.h
|
| index b593b992bb981ac8ae181f763f8ded0a9522bb5c..dac488e9fe3fb4981c062daa6f612ccf557574a2 100644
|
| --- a/src/heap-profiler.h
|
| +++ b/src/heap-profiler.h
|
| @@ -38,7 +38,15 @@ namespace internal {
|
| class HeapSnapshot;
|
| class HeapSnapshotsCollection;
|
|
|
| -#endif
|
| +#define HEAP_PROFILE(Call) \
|
| + do { \
|
| + if (v8::internal::HeapProfiler::is_profiling()) { \
|
| + v8::internal::HeapProfiler::Call; \
|
| + } \
|
| + } while (false)
|
| +#else
|
| +#define HEAP_PROFILE(Call) ((void) 0)
|
| +#endif // ENABLE_LOGGING_AND_PROFILING
|
|
|
| // The HeapProfiler writes data to the log files, which can be postprocessed
|
| // to generate .hp files for use by the GHC/Valgrind tool hp2ps.
|
| @@ -54,6 +62,12 @@ class HeapProfiler {
|
| static HeapSnapshot* GetSnapshot(int index);
|
| static HeapSnapshot* FindSnapshot(unsigned uid);
|
|
|
| + static void ObjectMoveEvent(Address from, Address to);
|
| +
|
| + static INLINE(bool is_profiling()) {
|
| + return singleton_ != NULL && singleton_->snapshots_->is_tracking_objects();
|
| + }
|
| +
|
| // Obsolete interface.
|
| // Write a single heap sample to the log file.
|
| static void WriteSample();
|
|
|