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

Unified Diff: src/allocation-tracker.h

Issue 177983003: [Heap profiler] Add construction stack trace to heap object (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 6 years, 9 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 | « no previous file | src/allocation-tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/allocation-tracker.h
diff --git a/src/allocation-tracker.h b/src/allocation-tracker.h
index cd8ac4b0888b2ee0d5278ddfbe10f8e11249070f..b876d7d14e706a4c4b153b2bb3ec5a2ddd2224a1 100644
--- a/src/allocation-tracker.h
+++ b/src/allocation-tracker.h
@@ -28,6 +28,8 @@
#ifndef V8_ALLOCATION_TRACKER_H_
#define V8_ALLOCATION_TRACKER_H_
+#include <map>
+
namespace v8 {
namespace internal {
@@ -81,6 +83,30 @@ class AllocationTraceTree {
};
+class AddressToTraceMap {
+ public:
+ void AddRange(Address addr, int size, unsigned node_id);
+ unsigned GetTraceNodeId(Address addr);
+ void MoveObject(Address from, Address to, int size);
+ void Clear();
+ size_t size() { return ranges_.size(); }
+ void Print();
+
+ private:
+ struct RangeStack {
+ RangeStack(Address start, unsigned node_id)
+ : start(start), trace_node_id(node_id) {}
+ Address start;
+ unsigned trace_node_id;
+ };
+ // [start, end) -> trace
+ typedef std::map<Address, RangeStack> RangeMap;
+
+ void RemoveRange(Address start, Address end);
+
+ RangeMap ranges_;
+};
+
class AllocationTracker {
public:
struct FunctionInfo {
@@ -103,6 +129,7 @@ class AllocationTracker {
const List<FunctionInfo*>& function_info_list() const {
return function_info_list_;
}
+ AddressToTraceMap* address_to_trace() { return &address_to_trace_; }
private:
unsigned AddFunctionInfo(SharedFunctionInfo* info, SnapshotObjectId id);
@@ -134,6 +161,7 @@ class AllocationTracker {
HashMap id_to_function_info_index_;
List<UnresolvedLocation*> unresolved_locations_;
unsigned info_index_for_other_state_;
+ AddressToTraceMap address_to_trace_;
DISALLOW_COPY_AND_ASSIGN(AllocationTracker);
};
« no previous file with comments | « no previous file | src/allocation-tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698