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

Unified Diff: src/allocation-tracker.h

Issue 177203002: Allocation tracker: add separate entry for allocations via V8 API (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reverted v8globals.h changes Created 6 years, 10 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 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);
};
« 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