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

Unified Diff: tools/profile.js

Issue 99054: TickProcessor script reimplemented in JavaScript. (Closed)
Patch Set: Addressed Soeren's comments Created 11 years, 8 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 | « tools/linux-tick-processor ('k') | tools/profileview.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/profile.js
diff --git a/tools/profile.js b/tools/profile.js
index d2b53223c042edcdb17063c625372264fd924fa4..70e30846da9ebef5dc135c234d8a9defee5fbadb 100644
--- a/tools/profile.js
+++ b/tools/profile.js
@@ -395,14 +395,16 @@ devtools.profiler.CallTree.prototype.computeTotalWeights = function() {
* @param {devtools.profiler.CallTree.Node} opt_start Starting node.
*/
devtools.profiler.CallTree.prototype.traverse = function(f, opt_start) {
- var pairsToProcess = [{node: opt_start || this.root_, param: null}];
- while (pairsToProcess.length > 0) {
- var pair = pairsToProcess.shift();
+ var pairsToProcess = new ConsArray();
+ pairsToProcess.concat([{node: opt_start || this.root_, param: null}]);
+ while (!pairsToProcess.atEnd()) {
+ var pair = pairsToProcess.next();
var node = pair.node;
var newParam = f(node, pair.param);
- node.forEachChild(
- function (child) { pairsToProcess.push({node: child, param: newParam}); }
- );
+ var morePairsToProcess = [];
+ node.forEachChild(function (child) {
+ morePairsToProcess.push({node: child, param: newParam}); });
+ pairsToProcess.concat(morePairsToProcess);
}
};
« no previous file with comments | « tools/linux-tick-processor ('k') | tools/profileview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698