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

Unified Diff: src/heap-profiler.h

Issue 242031: Heap profiler: correctly determine equivalence of objects having self-refs. (Closed)
Patch Set: Created 11 years, 3 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/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 b63c716af6b2ce731f3aeeb0657f177ecccacb5e..7fda883f87c1c60eca68649b4cac9793b3e06e0d 100644
--- a/src/heap-profiler.h
+++ b/src/heap-profiler.h
@@ -53,7 +53,8 @@ class JSObjectsCluster BASE_EMBEDDED {
// These special cases are used in retainer profile.
enum SpecialCase {
ROOTS = 1,
- GLOBAL_PROPERTY = 2
+ GLOBAL_PROPERTY = 2,
+ SELF = 3 // This case is used in ClustersCoarser only.
};
JSObjectsCluster() : constructor_(NULL), instance_(NULL) {}
@@ -77,6 +78,9 @@ class JSObjectsCluster BASE_EMBEDDED {
(a.instance_ == b.instance_ ? 0 : (a.instance_ < b.instance_ ? -1 : 1))
: cons_cmp;
}
+ static int Compare(const JSObjectsCluster* a, const JSObjectsCluster* b) {
+ return Compare(*a, *b);
+ }
bool is_null() const { return constructor_ == NULL; }
bool can_be_coarsed() const { return instance_ != NULL; }
@@ -93,6 +97,7 @@ class JSObjectsCluster BASE_EMBEDDED {
switch (special) {
case ROOTS: return Heap::result_symbol();
case GLOBAL_PROPERTY: return Heap::code_symbol();
+ case SELF: return Heap::catch_var_symbol();
default:
UNREACHABLE();
return NULL;
@@ -183,6 +188,8 @@ class ClustersCoarser BASE_EMBEDDED {
ClusterBackRefs& operator=(const ClusterBackRefs& src);
static int Compare(const ClusterBackRefs& a, const ClusterBackRefs& b);
+ void SortRefs() { refs.Sort(JSObjectsCluster::Compare); }
+ static void SortRefsIterator(ClusterBackRefs* ref) { ref->SortRefs(); }
JSObjectsCluster cluster;
ZoneList<JSObjectsCluster> refs;
@@ -219,6 +226,7 @@ class ClustersCoarser BASE_EMBEDDED {
EqualityTree eq_tree_;
ClusterBackRefs* current_pair_;
JSObjectsRetainerTree* current_set_;
+ const JSObjectsCluster* self_;
};
« no previous file with comments | « no previous file | src/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698