| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 }; | 194 }; |
| 195 typedef ZoneSplayTree<ClusterEqualityConfig> EqualityTree; | 195 typedef ZoneSplayTree<ClusterEqualityConfig> EqualityTree; |
| 196 | 196 |
| 197 static int ClusterBackRefsCmp( | 197 static int ClusterBackRefsCmp( |
| 198 const ClusterBackRefs* a, const ClusterBackRefs* b) { | 198 const ClusterBackRefs* a, const ClusterBackRefs* b) { |
| 199 return ClusterBackRefs::Compare(*a, *b); | 199 return ClusterBackRefs::Compare(*a, *b); |
| 200 } | 200 } |
| 201 int DoProcess(JSObjectsClusterTree* tree); | 201 int DoProcess(JSObjectsClusterTree* tree); |
| 202 int FillEqualityTree(); | 202 int FillEqualityTree(); |
| 203 | 203 |
| 204 static const int INITIAL_BACKREFS_LIST_CAPACITY = 2; | 204 static const int kInitialBackrefsListCapacity = 2; |
| 205 static const int INITIAL_SIMILARITY_LIST_CAPACITY = 2000; | 205 static const int kInitialSimilarityListCapacity = 2000; |
| 206 // Number of passes for finding equivalents. Limits the length of paths | 206 // Number of passes for finding equivalents. Limits the length of paths |
| 207 // that can be considered equivalent. | 207 // that can be considered equivalent. |
| 208 static const int MAX_PASSES_COUNT = 10; | 208 static const int kMaxPassesCount = 10; |
| 209 | 209 |
| 210 ZoneScope zscope_; | 210 ZoneScope zscope_; |
| 211 SimilarityList simList_; | 211 SimilarityList simList_; |
| 212 EqualityTree eqTree_; | 212 EqualityTree eqTree_; |
| 213 ClusterBackRefs* currentPair_; | 213 ClusterBackRefs* currentPair_; |
| 214 JSObjectsClusterTree* currentSet_; | 214 JSObjectsClusterTree* currentSet_; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 | 217 |
| 218 // RetainerHeapProfile is responsible for gathering and logging | 218 // RetainerHeapProfile is responsible for gathering and logging |
| (...skipping 11 matching lines...) Expand all Loading... |
| 230 RetainerHeapProfile(); | 230 RetainerHeapProfile(); |
| 231 void CollectStats(HeapObject* obj); | 231 void CollectStats(HeapObject* obj); |
| 232 void PrintStats(); | 232 void PrintStats(); |
| 233 void DebugPrintStats(Printer* printer); | 233 void DebugPrintStats(Printer* printer); |
| 234 void StoreReference(const JSObjectsCluster& cluster, Object* ref); | 234 void StoreReference(const JSObjectsCluster& cluster, Object* ref); |
| 235 | 235 |
| 236 private: | 236 private: |
| 237 JSObjectsCluster Clusterize(Object* obj); | 237 JSObjectsCluster Clusterize(Object* obj); |
| 238 | 238 |
| 239 // Limit on the number of retainers to be printed per cluster. | 239 // Limit on the number of retainers to be printed per cluster. |
| 240 static const int MAX_RETAINERS_TO_PRINT = 50; | 240 static const int kMaxRetainersToPrint = 50; |
| 241 ZoneScope zscope_; | 241 ZoneScope zscope_; |
| 242 JSObjectsClusterTree retainers_tree_; | 242 JSObjectsClusterTree retainers_tree_; |
| 243 ClustersCoarser coarser_; | 243 ClustersCoarser coarser_; |
| 244 // TODO(mnaganov): Use some helper class to hold these state variables. | 244 // TODO(mnaganov): Use some helper class to hold these state variables. |
| 245 JSObjectsClusterTree* coarse_cluster_tree_; | 245 JSObjectsClusterTree* coarse_cluster_tree_; |
| 246 int retainers_printed_; | 246 int retainers_printed_; |
| 247 Printer* current_printer_; | 247 Printer* current_printer_; |
| 248 StringStream* current_stream_; | 248 StringStream* current_stream_; |
| 249 public: | 249 public: |
| 250 // Used by JSObjectsClusterTree::ForEach. | 250 // Used by JSObjectsClusterTree::ForEach. |
| 251 void Call(const JSObjectsCluster& cluster, JSObjectsClusterTree* tree); | 251 void Call(const JSObjectsCluster& cluster, JSObjectsClusterTree* tree); |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 | 254 |
| 255 #endif // ENABLE_LOGGING_AND_PROFILING | 255 #endif // ENABLE_LOGGING_AND_PROFILING |
| 256 | 256 |
| 257 } } // namespace v8::internal | 257 } } // namespace v8::internal |
| 258 | 258 |
| 259 #endif // V8_HEAP_PROFILER_H_ | 259 #endif // V8_HEAP_PROFILER_H_ |
| OLD | NEW |