| Index: src/allocation-tracker.h
|
| diff --git a/src/allocation-tracker.h b/src/allocation-tracker.h
|
| index 1a5dc9e123c4ffe39f6c4bbdca5b3f32723a8540..cd8ac4b0888b2ee0d5278ddfbe10f8e11249070f 100644
|
| --- a/src/allocation-tracker.h
|
| +++ b/src/allocation-tracker.h
|
| @@ -38,13 +38,13 @@ class AllocationTraceTree;
|
| class AllocationTraceNode {
|
| public:
|
| AllocationTraceNode(AllocationTraceTree* tree,
|
| - SnapshotObjectId shared_function_info_id);
|
| + unsigned function_info_index);
|
| ~AllocationTraceNode();
|
| - AllocationTraceNode* FindChild(SnapshotObjectId shared_function_info_id);
|
| - AllocationTraceNode* FindOrAddChild(SnapshotObjectId shared_function_info_id);
|
| + AllocationTraceNode* FindChild(unsigned function_info_index);
|
| + AllocationTraceNode* FindOrAddChild(unsigned function_info_index);
|
| void AddAllocation(unsigned size);
|
|
|
| - SnapshotObjectId function_id() const { return function_id_; }
|
| + unsigned function_info_index() const { return function_info_index_; }
|
| unsigned allocation_size() const { return total_size_; }
|
| unsigned allocation_count() const { return allocation_count_; }
|
| unsigned id() const { return id_; }
|
| @@ -54,7 +54,7 @@ class AllocationTraceNode {
|
|
|
| private:
|
| AllocationTraceTree* tree_;
|
| - SnapshotObjectId function_id_;
|
| + unsigned function_info_index_;
|
| unsigned total_size_;
|
| unsigned allocation_count_;
|
| unsigned id_;
|
| @@ -68,7 +68,7 @@ class AllocationTraceTree {
|
| public:
|
| AllocationTraceTree();
|
| ~AllocationTraceTree();
|
| - AllocationTraceNode* AddPathFromEnd(const Vector<SnapshotObjectId>& path);
|
| + AllocationTraceNode* AddPathFromEnd(const Vector<unsigned>& path);
|
| AllocationTraceNode* root() { return &root_; }
|
| unsigned next_node_id() { return next_node_id_++; }
|
| void Print(AllocationTracker* tracker);
|
| @@ -86,6 +86,7 @@ class AllocationTracker {
|
| struct FunctionInfo {
|
| FunctionInfo();
|
| const char* name;
|
| + SnapshotObjectId function_id;
|
| const char* script_name;
|
| int script_id;
|
| int line;
|
| @@ -99,11 +100,14 @@ class AllocationTracker {
|
| void AllocationEvent(Address addr, int size);
|
|
|
| AllocationTraceTree* trace_tree() { return &trace_tree_; }
|
| - HashMap* id_to_function_info() { return &id_to_function_info_; }
|
| - FunctionInfo* GetFunctionInfo(SnapshotObjectId id);
|
| + const List<FunctionInfo*>& function_info_list() const {
|
| + return function_info_list_;
|
| + }
|
|
|
| private:
|
| - void AddFunctionInfo(SharedFunctionInfo* info, SnapshotObjectId id);
|
| + unsigned AddFunctionInfo(SharedFunctionInfo* info, SnapshotObjectId id);
|
| + static void DeleteFunctionInfo(FunctionInfo** info);
|
| + unsigned functionInfoIndexForVMState(StateTag state);
|
|
|
| class UnresolvedLocation {
|
| public:
|
| @@ -125,9 +129,11 @@ class AllocationTracker {
|
| HeapObjectsMap* ids_;
|
| StringsStorage* names_;
|
| AllocationTraceTree trace_tree_;
|
| - SnapshotObjectId allocation_trace_buffer_[kMaxAllocationTraceLength];
|
| - HashMap id_to_function_info_;
|
| + unsigned allocation_trace_buffer_[kMaxAllocationTraceLength];
|
| + List<FunctionInfo*> function_info_list_;
|
| + HashMap id_to_function_info_index_;
|
| List<UnresolvedLocation*> unresolved_locations_;
|
| + unsigned info_index_for_other_state_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AllocationTracker);
|
| };
|
|
|