Fix ARM build (gcc 3.3 failed to resolve types correctly) and constants names.
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Sep 2009 14:54:59 +0000 (14:54 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 16 Sep 2009 14:54:59 +0000 (14:54 +0000)
TBR=sgjesse@chromium.org

Review URL: http://codereview.chromium.org/195102

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2904 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/heap-profiler.cc
src/heap-profiler.h

index 2713602..038a943 100644 (file)
@@ -187,7 +187,7 @@ void JSObjectsCluster::DebugPrint(StringStream* accumulator) const {
 
 inline ClustersCoarser::ClusterBackRefs::ClusterBackRefs(
     const JSObjectsCluster& cluster_)
-    : cluster(cluster_), refs(INITIAL_BACKREFS_LIST_CAPACITY) {
+    : cluster(cluster_), refs(kInitialBackrefsListCapacity) {
 }
 
 
@@ -226,7 +226,7 @@ inline int ClustersCoarser::ClusterBackRefs::Compare(
 
 ClustersCoarser::ClustersCoarser()
   : zscope_(DELETE_ON_EXIT),
-    simList_(ClustersCoarser::INITIAL_SIMILARITY_LIST_CAPACITY),
+    simList_(ClustersCoarser::kInitialSimilarityListCapacity),
     currentPair_(NULL) {
 }
 
@@ -263,7 +263,7 @@ void ClustersCoarser::Call(
 
 void ClustersCoarser::Process(JSObjectsClusterTree* tree) {
   int last_eq_clusters = -1;
-  for (int i = 0; i < MAX_PASSES_COUNT; ++i) {
+  for (int i = 0; i < kMaxPassesCount; ++i) {
     simList_.Clear();
     const int curr_eq_clusters = DoProcess(tree);
     // If no new cluster equivalents discovered, abort processing.
@@ -339,8 +339,9 @@ RetainerHeapProfile::RetainerHeapProfile()
       retainers_printed_(0),
       current_printer_(NULL),
       current_stream_(NULL) {
+  JSObjectsCluster roots(JSObjectsCluster::ROOTS);
   ReferencesExtractor extractor(
-      JSObjectsCluster(JSObjectsCluster::ROOTS), this);
+      roots, this);
   Heap::IterateRoots(&extractor);
 }
 
@@ -384,8 +385,8 @@ void RetainerHeapProfile::CollectStats(HeapObject* obj) {
     ReferencesExtractor extractor(cluster, this);
     obj->Iterate(&extractor);
   } else if (obj->IsJSGlobalPropertyCell()) {
-    ReferencesExtractor extractor(
-        JSObjectsCluster(JSObjectsCluster::GLOBAL_PROPERTY), this);
+    JSObjectsCluster global_prop(JSObjectsCluster::GLOBAL_PROPERTY);
+    ReferencesExtractor extractor(global_prop, this);
     obj->Iterate(&extractor);
   }
 }
@@ -430,8 +431,8 @@ void RetainerHeapProfile::Call(
     // Second level of retainer graph.
     ASSERT(coarse_cluster_tree_ != NULL);
     ASSERT(current_stream_ != NULL);
-    if (retainers_printed_ >= MAX_RETAINERS_TO_PRINT) {
-      if (retainers_printed_ == MAX_RETAINERS_TO_PRINT) {
+    if (retainers_printed_ >= kMaxRetainersToPrint) {
+      if (retainers_printed_ == kMaxRetainersToPrint) {
         // TODO(mnaganov): Print the exact count.
         current_stream_->Add(",...");
         ++retainers_printed_;  // avoid printing ellipsis next time.
index 32a424f..bb7ca33 100644 (file)
@@ -201,11 +201,11 @@ class ClustersCoarser BASE_EMBEDDED {
   int DoProcess(JSObjectsClusterTree* tree);
   int FillEqualityTree();
 
-  static const int INITIAL_BACKREFS_LIST_CAPACITY = 2;
-  static const int INITIAL_SIMILARITY_LIST_CAPACITY = 2000;
+  static const int kInitialBackrefsListCapacity = 2;
+  static const int kInitialSimilarityListCapacity = 2000;
   // Number of passes for finding equivalents. Limits the length of paths
   // that can be considered equivalent.
-  static const int MAX_PASSES_COUNT = 10;
+  static const int kMaxPassesCount = 10;
 
   ZoneScope zscope_;
   SimilarityList simList_;
@@ -237,7 +237,7 @@ class RetainerHeapProfile BASE_EMBEDDED {
   JSObjectsCluster Clusterize(Object* obj);
 
   // Limit on the number of retainers to be printed per cluster.
-  static const int MAX_RETAINERS_TO_PRINT = 50;
+  static const int kMaxRetainersToPrint = 50;
   ZoneScope zscope_;
   JSObjectsClusterTree retainers_tree_;
   ClustersCoarser coarser_;