Changeset 112222 in webkit
- Timestamp:
- Mar 27, 2012 1:18:26 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r112219 r112222 1 2012-03-27 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: remove remains of path finder in heap profiler front-end 4 https://bugs.webkit.org/show_bug.cgi?id=82304 5 6 Removed remainders of heap path finder as this code is not used anymore. 7 8 Reviewed by Pavel Feldman. 9 10 * inspector/profiler/heap-snapshot-expected.txt: 11 * inspector/profiler/heap-snapshot.html: 12 1 13 2012-03-27 Philippe Normand <pnormand@igalia.com> 2 14 -
trunk/LayoutTests/inspector/profiler/heap-snapshot-expected.txt
r97611 r112222 24 24 Running: heapSnapshotEdgesProviderTest 25 25 26 Running: heapSnapshotPathFinderTest27 -
trunk/LayoutTests/inspector/profiler/heap-snapshot.html
r108729 r112222 212 212 InspectorTest.assertEquals("b", names.join(","), "edges provider names"); 213 213 next(); 214 },215 216 function heapSnapshotPathFinderTest(next)217 {218 var snapshot = new WebInspector.HeapSnapshot(InspectorTest.createHeapSnapshotMock());219 var expectedPaths = {220 1: [],221 14: [],222 27: ["A@2[1]"],223 40: ["A@2.ac", "A@2[1].bc", "B@3.bc"],224 50: ["A@2[1].bd", "B@3.bd"],225 57: ["A@2.ac.ce", "A@2[1].bc.ce", "B@3.bc.ce"]226 };227 for (var nodes = snapshot._allNodes; nodes.hasNext(); nodes.next()) {228 var pathFinder = new WebInspector.HeapSnapshotPathFinder(snapshot, nodes.index);229 var paths = [];230 var path;231 while (true) {232 path = pathFinder.findNext();233 if (path === null)234 break;235 else if (path !== false)236 paths.push(path.path);237 }238 paths.sort();239 InspectorTest.assertEquals(expectedPaths[nodes.index].join(";"), paths.join(";"), "paths to \"" + nodes.item.name + "\"");240 }241 next();242 214 } 243 215 ]); -
trunk/Source/WebCore/ChangeLog
r112220 r112222 1 2012-03-27 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: remove remains of path finder in heap profiler front-end 4 https://bugs.webkit.org/show_bug.cgi?id=82304 5 6 Removed remainders of heap path finder as this code is not used anymore. 7 8 Reviewed by Pavel Feldman. 9 10 * inspector/front-end/HeapSnapshot.js: 11 * inspector/front-end/HeapSnapshotProxy.js: 12 1 13 2012-03-27 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/Source/WebCore/inspector/front-end/HeapSnapshot.js
r112090 r112222 1471 1471 }, 1472 1472 1473 createPathFinder: function(targetNodeIndex, skipHidden)1474 {1475 return new WebInspector.HeapSnapshotPathFinder(this, targetNodeIndex, skipHidden);1476 },1477 1478 1473 updateStaticData: function() 1479 1474 { … … 1754 1749 WebInspector.HeapSnapshotNodesProvider.prototype.__proto__ = WebInspector.HeapSnapshotFilteredOrderedIterator.prototype; 1755 1750 1756 WebInspector.HeapSnapshotPathFinder = function(snapshot, targetNodeIndex, skipHidden)1757 {1758 this._snapshot = snapshot;1759 this._maxLength = 1;1760 this._lengthLimit = 15;1761 this._targetNodeIndex = targetNodeIndex;1762 this._currentPath = null;1763 this._skipHidden = skipHidden;1764 this._rootChildren = this._fillRootChildren();1765 }1766 1767 WebInspector.HeapSnapshotPathFinder.prototype = {1768 findNext: function()1769 {1770 for (var i = 0; i < 100000; ++i) {1771 if (!this._buildNextPath()) {1772 if (++this._maxLength >= this._lengthLimit)1773 return null;1774 this._currentPath = null;1775 if (!this._buildNextPath())1776 return null;1777 }1778 if (this._isPathFound())1779 return {path:this._pathToString(this._currentPath), route:this._pathToRoute(this._currentPath), len:this._currentPath.length};1780 }1781 1782 return false;1783 },1784 1785 updateRoots: function(filter)1786 {1787 if (filter)1788 filter = eval("(function(){return " + filter + "})()");1789 this._rootChildren = this._fillRootChildren(filter);1790 this._reset();1791 },1792 1793 _reset: function()1794 {1795 this._maxLength = 1;1796 this._currentPath = null;1797 },1798 1799 _fillRootChildren: function(filter)1800 {1801 var result = [];1802 for (var iter = this._snapshot.rootNode.edges; iter.hasNext(); iter.next()) {1803 if (!filter) {1804 if (!iter.edge.isShortcut)1805 result[iter.edge.nodeIndex] = true;1806 } else if (filter(iter.edge.node)) {1807 result[iter.edge.nodeIndex] = true;1808 }1809 }1810 return result;1811 },1812 1813 _appendToCurrentPath: function(iter)1814 {1815 this._currentPath._cache[this._lastEdge.nodeIndex] = true;1816 this._currentPath.push(iter);1817 },1818 1819 _removeLastFromCurrentPath: function()1820 {1821 this._currentPath.pop();1822 delete this._currentPath._cache[this._lastEdge.nodeIndex];1823 },1824 1825 _hasInPath: function(nodeIndex)1826 {1827 return this._targetNodeIndex === nodeIndex1828 || !!this._currentPath._cache[nodeIndex];1829 },1830 1831 _isPathFound: function()1832 {1833 return this._currentPath.length === this._maxLength1834 && this._lastEdge.nodeIndex in this._rootChildren;1835 },1836 1837 get _lastEdgeIter()1838 {1839 return this._currentPath[this._currentPath.length - 1];1840 },1841 1842 get _lastEdge()1843 {1844 return this._lastEdgeIter.item;1845 },1846 1847 _skipEdge: function(edge)1848 {1849 return edge.isInvisible1850 || (this._skipHidden && (edge.isHidden || edge.node.isHidden))1851 || edge.isWeak1852 || this._hasInPath(edge.nodeIndex);1853 },1854 1855 _nextEdgeIter: function()1856 {1857 var iter = this._lastEdgeIter;1858 while (iter.hasNext() && this._skipEdge(iter.item))1859 iter.next();1860 return iter;1861 },1862 1863 _buildNextPath: function()1864 {1865 if (this._currentPath !== null) {1866 var iter = this._lastEdgeIter;1867 while (true) {1868 iter.next();1869 iter = this._nextEdgeIter();1870 if (iter.hasNext())1871 return true;1872 while (true) {1873 if (this._currentPath.length > 1) {1874 this._removeLastFromCurrentPath();1875 iter = this._lastEdgeIter;1876 iter.next();1877 iter = this._nextEdgeIter();1878 if (iter.hasNext()) {1879 while (this._currentPath.length < this._maxLength) {1880 iter = this._nextEdgeIter();1881 if (iter.hasNext())1882 this._appendToCurrentPath(iter.item.node.retainers);1883 else1884 return true;1885 }1886 return true;1887 }1888 } else1889 return false;1890 }1891 }1892 } else {1893 var node = new WebInspector.HeapSnapshotNode(this._snapshot, this._targetNodeIndex);1894 this._currentPath = [node.retainers];1895 this._currentPath._cache = {};1896 while (this._currentPath.length < this._maxLength) {1897 var iter = this._nextEdgeIter();1898 if (iter.hasNext())1899 this._appendToCurrentPath(iter.item.node.retainers);1900 else1901 break;1902 }1903 return true;1904 }1905 },1906 1907 _nodeToString: function(node)1908 {1909 if (node.id === 1)1910 return node.name;1911 else1912 return node.name + "@" + node.id;1913 },1914 1915 _pathToString: function(path)1916 {1917 if (!path)1918 return "";1919 var sPath = [];1920 for (var j = 0; j < path.length; ++j)1921 sPath.push(path[j].item.toString());1922 sPath.push(this._nodeToString(path[path.length - 1].item.node));1923 sPath.reverse();1924 return sPath.join("");1925 },1926 1927 _pathToRoute: function(path)1928 {1929 if (!path)1930 return [];1931 var route = [];1932 route.push(this._targetNodeIndex);1933 for (var i = 0; i < path.length; ++i)1934 route.push(path[i].item.nodeIndex);1935 route.reverse();1936 return route;1937 }1938 };1939 1940 1751 WebInspector.HeapSnapshotsDiff = function(snapshot, className) 1941 1752 { -
trunk/Source/WebCore/inspector/front-end/HeapSnapshotProxy.js
r111704 r112222 355 355 }, 356 356 357 createPathFinder: function(targetNodeIndex, skipHidden)358 {359 return this.callFactoryMethod(null, "createPathFinder", "WebInspector.HeapSnapshotPathFinderProxy", targetNodeIndex, skipHidden);360 },361 362 357 dispose: function() 363 358 {
Note: See TracChangeset
for help on using the changeset viewer.