Fix variables names.

TBR=kasperl@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2905 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3b1818db
...@@ -69,19 +69,19 @@ class ReferencesExtractor : public ObjectVisitor { ...@@ -69,19 +69,19 @@ class ReferencesExtractor : public ObjectVisitor {
const JSObjectsCluster& cluster, RetainerHeapProfile* profile) const JSObjectsCluster& cluster, RetainerHeapProfile* profile)
: cluster_(cluster), : cluster_(cluster),
profile_(profile), profile_(profile),
insideArray_(false) { inside_array_(false) {
} }
void VisitPointer(Object** o) { void VisitPointer(Object** o) {
if ((*o)->IsJSObject() || (*o)->IsString()) { if ((*o)->IsJSObject() || (*o)->IsString()) {
profile_->StoreReference(cluster_, *o); profile_->StoreReference(cluster_, *o);
} else if ((*o)->IsFixedArray() && !insideArray_) { } else if ((*o)->IsFixedArray() && !inside_array_) {
// Traverse one level deep for data members that are fixed arrays. // Traverse one level deep for data members that are fixed arrays.
// This covers the case of 'elements' and 'properties' of JSObject, // This covers the case of 'elements' and 'properties' of JSObject,
// and function contexts. // and function contexts.
insideArray_ = true; inside_array_ = true;
FixedArray::cast(*o)->Iterate(this); FixedArray::cast(*o)->Iterate(this);
insideArray_ = false; inside_array_ = false;
} }
} }
...@@ -92,7 +92,7 @@ class ReferencesExtractor : public ObjectVisitor { ...@@ -92,7 +92,7 @@ class ReferencesExtractor : public ObjectVisitor {
private: private:
const JSObjectsCluster& cluster_; const JSObjectsCluster& cluster_;
RetainerHeapProfile* profile_; RetainerHeapProfile* profile_;
bool insideArray_; bool inside_array_;
}; };
...@@ -226,8 +226,8 @@ inline int ClustersCoarser::ClusterBackRefs::Compare( ...@@ -226,8 +226,8 @@ inline int ClustersCoarser::ClusterBackRefs::Compare(
ClustersCoarser::ClustersCoarser() ClustersCoarser::ClustersCoarser()
: zscope_(DELETE_ON_EXIT), : zscope_(DELETE_ON_EXIT),
simList_(ClustersCoarser::kInitialSimilarityListCapacity), sim_list_(ClustersCoarser::kInitialSimilarityListCapacity),
currentPair_(NULL) { current_pair_(NULL) {
} }
...@@ -237,25 +237,25 @@ void ClustersCoarser::Call( ...@@ -237,25 +237,25 @@ void ClustersCoarser::Call(
// First level of retainer graph. // First level of retainer graph.
if (!cluster.can_be_coarsed()) return; if (!cluster.can_be_coarsed()) return;
ClusterBackRefs pair(cluster); ClusterBackRefs pair(cluster);
ASSERT(currentPair_ == NULL); ASSERT(current_pair_ == NULL);
currentPair_ = &pair; current_pair_ = &pair;
currentSet_ = new JSObjectsClusterTree(); current_set_ = new JSObjectsClusterTree();
tree->ForEach(this); tree->ForEach(this);
simList_.Add(pair); sim_list_.Add(pair);
currentPair_ = NULL; current_pair_ = NULL;
currentSet_ = NULL; current_set_ = NULL;
} else { } else {
// Second level of retainer graph. // Second level of retainer graph.
ASSERT(currentPair_ != NULL); ASSERT(current_pair_ != NULL);
ASSERT(currentSet_ != NULL); ASSERT(current_set_ != NULL);
JSObjectsCluster eq = GetCoarseEquivalent(cluster); JSObjectsCluster eq = GetCoarseEquivalent(cluster);
JSObjectsClusterTree::Locator loc; JSObjectsClusterTree::Locator loc;
if (!eq.is_null()) { if (!eq.is_null()) {
if (currentSet_->Find(eq, &loc)) return; if (current_set_->Find(eq, &loc)) return;
currentPair_->refs.Add(eq); current_pair_->refs.Add(eq);
currentSet_->Insert(eq, &loc); current_set_->Insert(eq, &loc);
} else { } else {
currentPair_->refs.Add(cluster); current_pair_->refs.Add(cluster);
} }
} }
} }
...@@ -264,7 +264,7 @@ void ClustersCoarser::Call( ...@@ -264,7 +264,7 @@ void ClustersCoarser::Call(
void ClustersCoarser::Process(JSObjectsClusterTree* tree) { void ClustersCoarser::Process(JSObjectsClusterTree* tree) {
int last_eq_clusters = -1; int last_eq_clusters = -1;
for (int i = 0; i < kMaxPassesCount; ++i) { for (int i = 0; i < kMaxPassesCount; ++i) {
simList_.Clear(); sim_list_.Clear();
const int curr_eq_clusters = DoProcess(tree); const int curr_eq_clusters = DoProcess(tree);
// If no new cluster equivalents discovered, abort processing. // If no new cluster equivalents discovered, abort processing.
if (last_eq_clusters == curr_eq_clusters) break; if (last_eq_clusters == curr_eq_clusters) break;
...@@ -280,7 +280,7 @@ int ClustersCoarser::DoProcess(JSObjectsClusterTree* tree) { ...@@ -280,7 +280,7 @@ int ClustersCoarser::DoProcess(JSObjectsClusterTree* tree) {
// be considered equivalent. But we don't sort them explicitly // be considered equivalent. But we don't sort them explicitly
// because we know that they come from a splay tree traversal, so // because we know that they come from a splay tree traversal, so
// they are already sorted. // they are already sorted.
simList_.Sort(ClusterBackRefsCmp); sim_list_.Sort(ClusterBackRefsCmp);
return FillEqualityTree(); return FillEqualityTree();
} }
...@@ -289,7 +289,7 @@ JSObjectsCluster ClustersCoarser::GetCoarseEquivalent( ...@@ -289,7 +289,7 @@ JSObjectsCluster ClustersCoarser::GetCoarseEquivalent(
const JSObjectsCluster& cluster) { const JSObjectsCluster& cluster) {
if (!cluster.can_be_coarsed()) return JSObjectsCluster(); if (!cluster.can_be_coarsed()) return JSObjectsCluster();
EqualityTree::Locator loc; EqualityTree::Locator loc;
return eqTree_.Find(cluster, &loc) ? loc.value() : JSObjectsCluster(); return eq_tree_.Find(cluster, &loc) ? loc.value() : JSObjectsCluster();
} }
...@@ -301,28 +301,28 @@ bool ClustersCoarser::HasAnEquivalent(const JSObjectsCluster& cluster) { ...@@ -301,28 +301,28 @@ bool ClustersCoarser::HasAnEquivalent(const JSObjectsCluster& cluster) {
int ClustersCoarser::FillEqualityTree() { int ClustersCoarser::FillEqualityTree() {
int eqClustersCount = 0; int eq_clusters_count = 0;
int eqTo = 0; int eq_to = 0;
bool firstAdded = false; bool first_added = false;
for (int i = 1; i < simList_.length(); ++i) { for (int i = 1; i < sim_list_.length(); ++i) {
if (ClusterBackRefs::Compare(simList_[i], simList_[eqTo]) == 0) { if (ClusterBackRefs::Compare(sim_list_[i], sim_list_[eq_to]) == 0) {
EqualityTree::Locator loc; EqualityTree::Locator loc;
if (!firstAdded) { if (!first_added) {
// Add self-equivalence, if we have more than one item in this // Add self-equivalence, if we have more than one item in this
// equivalence class. // equivalence class.
eqTree_.Insert(simList_[eqTo].cluster, &loc); eq_tree_.Insert(sim_list_[eq_to].cluster, &loc);
loc.set_value(simList_[eqTo].cluster); loc.set_value(sim_list_[eq_to].cluster);
firstAdded = true; first_added = true;
} }
eqTree_.Insert(simList_[i].cluster, &loc); eq_tree_.Insert(sim_list_[i].cluster, &loc);
loc.set_value(simList_[eqTo].cluster); loc.set_value(sim_list_[eq_to].cluster);
++eqClustersCount; ++eq_clusters_count;
} else { } else {
eqTo = i; eq_to = i;
firstAdded = false; first_added = false;
} }
} }
return eqClustersCount; return eq_clusters_count;
} }
...@@ -373,9 +373,9 @@ void RetainerHeapProfile::StoreReference( ...@@ -373,9 +373,9 @@ void RetainerHeapProfile::StoreReference(
if (retainers_tree_.Insert(ref_cluster, &ref_loc)) { if (retainers_tree_.Insert(ref_cluster, &ref_loc)) {
ref_loc.set_value(new JSObjectsClusterTree()); ref_loc.set_value(new JSObjectsClusterTree());
} }
JSObjectsClusterTree* referencedBy = ref_loc.value(); JSObjectsClusterTree* referenced_by = ref_loc.value();
JSObjectsClusterTree::Locator obj_loc; JSObjectsClusterTree::Locator obj_loc;
referencedBy->Insert(cluster, &obj_loc); referenced_by->Insert(cluster, &obj_loc);
} }
......
...@@ -208,10 +208,10 @@ class ClustersCoarser BASE_EMBEDDED { ...@@ -208,10 +208,10 @@ class ClustersCoarser BASE_EMBEDDED {
static const int kMaxPassesCount = 10; static const int kMaxPassesCount = 10;
ZoneScope zscope_; ZoneScope zscope_;
SimilarityList simList_; SimilarityList sim_list_;
EqualityTree eqTree_; EqualityTree eq_tree_;
ClusterBackRefs* currentPair_; ClusterBackRefs* current_pair_;
JSObjectsClusterTree* currentSet_; JSObjectsClusterTree* current_set_;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment