| Index: src/heap-profiler.h
|
| diff --git a/src/heap-profiler.h b/src/heap-profiler.h
|
| index 5ae60fa923449458ab95670c902f3c99c63f251b..a1963f77ae9128ae4ad3c70432788ba07fc12027 100644
|
| --- a/src/heap-profiler.h
|
| +++ b/src/heap-profiler.h
|
| @@ -63,13 +63,31 @@ class HeapProfiler {
|
|
|
| void StartHeapObjectsTracking();
|
| void StopHeapObjectsTracking();
|
| +
|
| + INLINE(void RecordObjectAllocation(Address obj, size_t size)) {
|
| + if (is_tracking_allocations_) {
|
| + NewObjectEvent(obj, size);
|
| + }
|
| + }
|
| +
|
| + static void RecordObjectAllocationFromMasm(Isolate* isolate,
|
| + Address obj,
|
| + int size) {
|
| + // Set the lsb to 0 if needed.
|
| + obj = reinterpret_cast<Address>(
|
| + reinterpret_cast<uintptr_t>(obj) & ~kHeapObjectTag);
|
| + isolate->heap_profiler()->NewObjectEvent(obj, size);
|
| + }
|
| +
|
| SnapshotObjectId PushHeapObjectsStats(OutputStream* stream);
|
| int GetSnapshotsCount();
|
| HeapSnapshot* GetSnapshot(int index);
|
| SnapshotObjectId GetSnapshotObjectId(Handle<Object> obj);
|
| void DeleteAllSnapshots();
|
|
|
| - void ObjectMoveEvent(Address from, Address to);
|
| + void ObjectMoveEvent(Address from, Address to, int size);
|
| +
|
| + void NewObjectEvent(Address addr, int size);
|
|
|
| void DefineWrapperClass(
|
| uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback);
|
| @@ -82,12 +100,17 @@ class HeapProfiler {
|
|
|
| void SetRetainedObjectInfo(UniqueId id, RetainedObjectInfo* info);
|
|
|
| + int* is_tracking_allocations_address();
|
| +
|
| + int CheckAllocationsTracking();
|
| +
|
| private:
|
| Heap* heap() const { return snapshots_->heap(); }
|
|
|
| HeapSnapshotsCollection* snapshots_;
|
| unsigned next_snapshot_uid_;
|
| List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_;
|
| + int is_tracking_allocations_;
|
| };
|
|
|
| } } // namespace v8::internal
|
|
|