| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 return; | 1322 return; |
| 1323 distances[ordinal] = distance; | 1323 distances[ordinal] = distance; |
| 1324 nodesToVisit[nodesToVisitLength++] = node.nodeIndex; | 1324 nodesToVisit[nodesToVisitLength++] = node.nodeIndex; |
| 1325 } | 1325 } |
| 1326 | 1326 |
| 1327 this.forEachRoot(enqueueNode.bind(null, 1), true); | 1327 this.forEachRoot(enqueueNode.bind(null, 1), true); |
| 1328 this._bfs(nodesToVisit, nodesToVisitLength, distances); | 1328 this._bfs(nodesToVisit, nodesToVisitLength, distances); |
| 1329 | 1329 |
| 1330 // bfs for the rest of objects | 1330 // bfs for the rest of objects |
| 1331 nodesToVisitLength = 0; | 1331 nodesToVisitLength = 0; |
| 1332 this.forEachRoot(enqueueNode.bind(null, 0), false); | 1332 this.forEachRoot(enqueueNode.bind(null, WebInspector.HeapSnapshotCommon.
baseSystemDistance), false); |
| 1333 this._bfs(nodesToVisit, nodesToVisitLength, distances); | 1333 this._bfs(nodesToVisit, nodesToVisitLength, distances); |
| 1334 }, | 1334 }, |
| 1335 | 1335 |
| 1336 /** | 1336 /** |
| 1337 * @param {!Uint32Array} nodesToVisit | 1337 * @param {!Uint32Array} nodesToVisit |
| 1338 * @param {!number} nodesToVisitLength | 1338 * @param {!number} nodesToVisitLength |
| 1339 * @param {!Int32Array} distances | 1339 * @param {!Int32Array} distances |
| 1340 */ | 1340 */ |
| 1341 _bfs: function(nodesToVisit, nodesToVisitLength, distances) | 1341 _bfs: function(nodesToVisit, nodesToVisitLength, distances) |
| 1342 { | 1342 { |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 * @param {number} windowRight | 2311 * @param {number} windowRight |
| 2312 */ | 2312 */ |
| 2313 sort: function(comparator, leftBound, rightBound, windowLeft, windowRight) | 2313 sort: function(comparator, leftBound, rightBound, windowLeft, windowRight) |
| 2314 { | 2314 { |
| 2315 this._iterationOrder.sortRange(this._buildCompareFunction(comparator), l
eftBound, rightBound, windowLeft, windowRight); | 2315 this._iterationOrder.sortRange(this._buildCompareFunction(comparator), l
eftBound, rightBound, windowLeft, windowRight); |
| 2316 }, | 2316 }, |
| 2317 | 2317 |
| 2318 __proto__: WebInspector.HeapSnapshotItemProvider.prototype | 2318 __proto__: WebInspector.HeapSnapshotItemProvider.prototype |
| 2319 } | 2319 } |
| 2320 | 2320 |
| OLD | NEW |