| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 void NewObjectEvent(Address addr, int size); | 67 void NewObjectEvent(Address addr, int size); |
| 68 | 68 |
| 69 void UpdateObjectSizeEvent(Address addr, int size); | 69 void UpdateObjectSizeEvent(Address addr, int size); |
| 70 | 70 |
| 71 void DefineWrapperClass( | 71 void DefineWrapperClass( |
| 72 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); | 72 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); |
| 73 | 73 |
| 74 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, | 74 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, |
| 75 Object** wrapper); | 75 Object** wrapper); |
| 76 INLINE(bool is_profiling()) { | |
| 77 return snapshots_->is_tracking_objects(); | |
| 78 } | |
| 79 | |
| 80 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); | 76 void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info); |
| 81 | 77 |
| 82 bool is_tracking_allocations() { | 78 bool is_tracking_object_moves() const { return is_tracking_object_moves_; } |
| 83 return is_tracking_allocations_; | 79 bool is_tracking_allocations() const { return is_tracking_allocations_; } |
| 84 } | |
| 85 | 80 |
| 86 void StartHeapAllocationsRecording(); | 81 void StartHeapAllocationsRecording(); |
| 87 void StopHeapAllocationsRecording(); | 82 void StopHeapAllocationsRecording(); |
| 88 | 83 |
| 89 int FindUntrackedObjects() { | 84 int FindUntrackedObjects() { |
| 90 return snapshots_->FindUntrackedObjects(); | 85 return snapshots_->FindUntrackedObjects(); |
| 91 } | 86 } |
| 92 | 87 |
| 93 private: | 88 private: |
| 94 Heap* heap() const { return snapshots_->heap(); } | 89 Heap* heap() const { return snapshots_->heap(); } |
| 95 | 90 |
| 96 HeapSnapshotsCollection* snapshots_; | 91 HeapSnapshotsCollection* snapshots_; |
| 97 unsigned next_snapshot_uid_; | 92 unsigned next_snapshot_uid_; |
| 98 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 93 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
| 99 bool is_tracking_allocations_; | 94 bool is_tracking_allocations_; |
| 95 bool is_tracking_object_moves_; |
| 100 }; | 96 }; |
| 101 | 97 |
| 102 } } // namespace v8::internal | 98 } } // namespace v8::internal |
| 103 | 99 |
| 104 #endif // V8_HEAP_PROFILER_H_ | 100 #endif // V8_HEAP_PROFILER_H_ |
| OLD | NEW |