Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: src/heap-profiler.h

Issue 23039014: Hook-allocation on bleeding edge (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.cc ('k') | src/heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/heap.cc ('k') | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698