Bug 1118469 - Rename some variables for clarity, r=me
authorSteve Fink <sfink@mozilla.com>
Thu, 08 Jan 2015 22:40:39 -0800
changeset 248688 5dd6ef47090841c82e6f3d37ea071306acf37b79
parent 248687 4d6c57214b1d619e73e2b3cb6517199767dfaffa
child 248689 575af71f0b2414484878c0ab118c6365affc0837
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1118469
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1118469 - Rename some variables for clarity, r=me
js/src/devtools/rootAnalysis/computeGCTypes.js
--- a/js/src/devtools/rootAnalysis/computeGCTypes.js
+++ b/js/src/devtools/rootAnalysis/computeGCTypes.js
@@ -60,71 +60,71 @@ for (var csuIndex = minStream; csuIndex 
     xdb.free_string(csu);
     xdb.free_string(data);
 }
 
 var gcTypes = {}; // map from parent struct => Set of GC typed children
 var gcPointers = {}; // map from parent struct => Set of GC typed children
 var gcFields = {};
 
-function addGCType(name, child, why)
+function addGCType(typeName, child, why)
 {
     if (!why)
         why = '<annotation>';
     if (!child)
         child = 'annotation';
 
-    if (isRootedTypeName(name))
+    if (isRootedTypeName(typeName))
         return;
 
-    if (!(name in gcTypes))
-        gcTypes[name] = Set();
-    gcTypes[name].add(why);
+    if (!(typeName in gcTypes))
+        gcTypes[typeName] = Set();
+    gcTypes[typeName].add(why);
 
-    if (!(name in gcFields))
-        gcFields[name] = Map();
-    gcFields[name].set(why, child);
+    if (!(typeName in gcFields))
+        gcFields[typeName] = Map();
+    gcFields[typeName].set(why, child);
 
-    if (name in structureParents) {
-        for (var field of structureParents[name]) {
-            var [ holder, fieldName ] = field;
-            addGCType(holder, name, fieldName);
+    if (typeName in structureParents) {
+        for (var field of structureParents[typeName]) {
+            var [ holderType, fieldName ] = field;
+            addGCType(holderType, typeName, fieldName);
         }
     }
-    if (name in pointerParents) {
-        for (var field of pointerParents[name]) {
-            var [ holder, fieldName ] = field;
-            addGCPointer(holder, name, fieldName);
+    if (typeName in pointerParents) {
+        for (var field of pointerParents[typeName]) {
+            var [ holderType, fieldName ] = field;
+            addGCPointer(holderType, typeName, fieldName);
         }
     }
 }
 
-function addGCPointer(name, child, why)
+function addGCPointer(typeName, child, why)
 {
     if (!why)
         why = '<annotation>';
     if (!child)
         child = 'annotation';
 
     // Ignore types that are properly rooted.
-    if (isRootedPointerTypeName(name))
+    if (isRootedPointerTypeName(typeName))
         return;
 
-    if (!(name in gcPointers))
-        gcPointers[name] = Set();
-    gcPointers[name].add(why);
+    if (!(typeName in gcPointers))
+        gcPointers[typeName] = Set();
+    gcPointers[typeName].add(why);
 
-    if (!(name in gcFields))
-        gcFields[name] = Map();
-    gcFields[name].set(why, child);
+    if (!(typeName in gcFields))
+        gcFields[typeName] = Map();
+    gcFields[typeName].set(why, child);
 
-    if (name in structureParents) {
-        for (var field of structureParents[name]) {
+    if (typeName in structureParents) {
+        for (var field of structureParents[typeName]) {
             var [ holder, fieldName ] = field;
-            addGCPointer(holder, name, fieldName);
+            addGCPointer(holder, typeName, fieldName);
         }
     }
 }
 
 addGCType('JSObject');
 addGCType('JSString');
 addGCType('js::Shape');
 addGCType('js::BaseShape');